Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ur ibcs-3.8.org/coff/binfmt-coff.c ibcs-3.8/coff/binfmt-coff.c
- --- ibcs-3.8.org/coff/binfmt-coff.c 2008-07-25 21:03:35.000000000 -0500
- +++ ibcs-3.8/coff/binfmt-coff.c 2009-09-18 15:54:06.000000000 -0500
- @@ -66,7 +66,6 @@
- };
- #endif
- -
- typedef struct coff_section {
- long scnptr;
- long size;
- @@ -320,10 +319,17 @@
- int pageable = 1, sections = 0, status = 0, i, ce;
- int coff_exec_fileno;
- mm_segment_t old_fs;
- + kernel_cap_t cur_cap_effective;
- +
- +#if _KSL > 30
- + cur_cap_effective = current_cap();
- +#else
- + cur_cap_effective = current->cap_effective;
- +#endif
- lPers = abi_personality((char *)_BX(regs));
- - ce = cap_raised(current->cap_effective,CAP_SYS_RAWIO);
- + ce = cap_raised(cur_cap_effective,CAP_SYS_RAWIO);
- coff_hdr = (COFF_FILHDR *)bprm->buf;
- @@ -623,7 +629,11 @@
- (current->mm->start_brk = bss.vaddr);
- current->mm->start_stack = p;
- +#if _KSL > 30
- + install_exec_creds(bprm);
- +#else
- compute_creds(bprm);
- +#endif
- #if _KSL < 15
- #ifdef CONFIG_64BIT
- @@ -676,11 +686,11 @@
- status = 0;
- } else {
- /* map the text pages...*/
- - cap_raise(current->cap_effective,CAP_SYS_RAWIO);
- + cap_raise(cur_cap_effective,CAP_SYS_RAWIO);
- m_addr = map_coff(bprm->file, &text, PROT_READ | PROT_EXEC,
- MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
- text.scnptr & PAGE_MASK);
- - if(!ce) cap_lower(current->cap_effective,CAP_SYS_RAWIO);
- + if(!ce) cap_lower(cur_cap_effective,CAP_SYS_RAWIO);
- if (m_addr != (text.vaddr & PAGE_MASK)) {
- status = -ENOEXEC;
- @@ -690,12 +700,12 @@
- /* map the data pages */
- if (data.size != 0) {
- - cap_raise(current->cap_effective,CAP_SYS_RAWIO);
- + cap_raise(cur_cap_effective,CAP_SYS_RAWIO);
- m_addr = map_coff(bprm->file, &data,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
- data.scnptr & PAGE_MASK);
- - if(!ce) cap_lower(current->cap_effective,CAP_SYS_RAWIO);
- + if(!ce) cap_lower(cur_cap_effective,CAP_SYS_RAWIO);
- if (m_addr != (data.vaddr & PAGE_MASK)) {
- status = -ENOEXEC;
- @@ -713,7 +723,7 @@
- * of the bss section. Allocate any necessary pages for the data.
- */
- if (bss.size != 0) {
- - cap_raise(current->cap_effective,CAP_SYS_RAWIO);
- + cap_raise(cur_cap_effective,CAP_SYS_RAWIO);
- down_write(¤t->mm->mmap_sem);
- do_mmap(NULL, PAGE_ALIGN(bss.vaddr),
- bss.size + bss.vaddr -
- @@ -721,7 +731,7 @@
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_FIXED | MAP_PRIVATE | MAP_32BIT, 0);
- up_write(¤t->mm->mmap_sem);
- - if(!ce) cap_lower(current->cap_effective,CAP_SYS_RAWIO);
- + if(!ce) cap_lower(cur_cap_effective,CAP_SYS_RAWIO);
- if ((status = coff_clear_memory(bss.vaddr, bss.size)) < 0) {
- set_fs(old_fs);
- diff -ur ibcs-3.8.org/cxenix/misc.c ibcs-3.8/cxenix/misc.c
- --- ibcs-3.8.org/cxenix/misc.c 2008-07-16 07:49:22.000000000 -0500
- +++ ibcs-3.8/cxenix/misc.c 2009-09-18 17:13:37.000000000 -0500
- @@ -301,16 +301,21 @@
- uid_t ouid;
- gid_t ogid;
- int err;
- +#if _KSL > 30
- + struct cred *cred = current_cred();
- +#else
- + struct task_struct cred = current;
- +#endif
- - ouid = current->uid;
- - ogid = current->gid;
- - current->uid = current->euid;
- - current->gid = current->egid;
- + ouid = cred->uid;
- + ogid = cred->gid;
- + cred->uid = cred->euid;
- + cred->gid = cred->egid;
- err = SYS(access,path, mode);
- - current->uid = ouid;
- - current->gid = ogid;
- + cred->uid = ouid;
- + cred->gid = ogid;
- return err;
- }
- diff -ur ibcs-3.8.org/sco/secureware.c ibcs-3.8/sco/secureware.c
- --- ibcs-3.8.org/sco/secureware.c 2007-02-27 10:02:00.000000000 -0600
- +++ ibcs-3.8/sco/secureware.c 2009-09-18 17:14:40.000000000 -0500
- @@ -46,7 +46,11 @@
- * specifically so we'll just use the real uid
- * instead - it should be good enough.
- */
- +#if _KSL > 30
- + return (current_cred()->uid);
- +#else
- return (current->uid);
- +#endif
- case SW_SETLUID:
- /*
- * Strictly we should only be able to call setluid()
- diff -ur ibcs-3.8.org/svr4/misc.c ibcs-3.8/svr4/misc.c
- --- ibcs-3.8.org/svr4/misc.c 2009-01-31 18:42:01.000000000 -0600
- +++ ibcs-3.8/svr4/misc.c 2009-09-18 17:17:19.000000000 -0500
- @@ -227,8 +227,13 @@
- int
- abi_getuid(struct pt_regs *regs)
- {
- +#if _KSL > 30
- + _DX(regs) = current_cred()->euid;
- + return current_cred()->uid;
- +#else
- _DX(regs) = current->euid;
- return current->uid;
- +#endif
- }
- /*
- @@ -237,8 +242,13 @@
- int
- abi_getgid(struct pt_regs *regs)
- {
- +#if _KSL > 30
- + _DX(regs) = current_cred()->egid;
- + return current_cred()->gid;
- +#else
- _DX(regs) = current->egid;
- return current->gid;
- +#endif
- }
- diff -ur ibcs-3.8.org/uw7/access.c ibcs-3.8/uw7/access.c
- --- ibcs-3.8.org/uw7/access.c 2009-01-23 17:31:43.000000000 -0600
- +++ ibcs-3.8/uw7/access.c 2009-09-18 17:21:01.000000000 -0500
- @@ -103,14 +103,19 @@
- mode |= UW7_X_OK;
- }
- if (mode & UW7_EFF_ONLY_OK) {
- - uid_t old_uid = current->uid, old_gid = current->gid;
- +#if _KSL > 30
- + struct cred *cred = current_cred();
- +#else
- + struct task_struct cred = current;
- +#endif
- + uid_t old_uid = cred->uid, old_gid = cred->gid;
- - current->uid = current->euid;
- - current->gid = current->egid;
- + cred->uid = cred->euid;
- + cred->gid = cred->egid;
- mode &= ~UW7_EFF_ONLY_OK;
- error = SYS(access,filename, mode);
- - current->uid = old_uid;
- - current->gid = old_gid;
- + cred->uid = old_uid;
- + cred->gid = old_gid;
- } else
- error = SYS(access,filename, mode);
- diff -ur ibcs-3.8.org/xout/binfmt-xout.c ibcs-3.8/xout/binfmt-xout.c
- --- ibcs-3.8.org/xout/binfmt-xout.c 2008-07-25 20:51:03.000000000 -0500
- +++ ibcs-3.8/xout/binfmt-xout.c 2009-09-18 17:30:42.000000000 -0500
- @@ -149,9 +149,15 @@
- {
- u_long bss_size, bss_base, ce;
- int err = 0;
- + kernel_cap_t cur_cap_effective;
- - ce = cap_raised(current->cap_effective,CAP_SYS_RAWIO);
- - cap_raise(current->cap_effective,CAP_SYS_RAWIO);
- +#if _KSL > 30
- + cur_cap_effective = current_cap();
- +#else
- + cur_cap_effective = current->cap_effective;
- +#endif
- + ce = cap_raised(cur_cap_effective,CAP_SYS_RAWIO);
- + cap_raise(cur_cap_effective,CAP_SYS_RAWIO);
- bss_size = sp->xs_vsize - sp->xs_psize;
- bss_base = sp->xs_rbase + sp->xs_psize;
- @@ -222,7 +228,7 @@
- }
- out:
- - if (!ce) cap_lower(current->cap_effective,CAP_SYS_RAWIO);
- + if (!ce) cap_lower(cur_cap_effective,CAP_SYS_RAWIO);
- return (err);
- }
- @@ -397,7 +403,11 @@
- current->mm->start_brk =
- current->mm->brk = xexec->x_text + xexec->x_data + xexec->x_bss;
- +#if _KSL > 30
- + install_exec_creds(bpp);
- +#else
- compute_creds(bpp);
- +#endif
- current->flags &= ~PF_FORKNOEXEC;
- #if _KSL < 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement