]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Jan 2009 21:59:25 +0000 (13:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Jan 2009 21:59:25 +0000 (13:59 -0800)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  CRED: Fix commit_creds() on a process that has no mm

1  2 
kernel/cred.c

diff --combined kernel/cred.c
index 043f78c133c46ccbfe4a56bcbf92b35e57f92018,480a61aec805a5430ab4ec8359c78032177572a6..3a039189d70748b294082301d9636d467c019c3b
@@@ -372,7 -372,8 +372,8 @@@ int commit_creds(struct cred *new
            old->fsuid != new->fsuid ||
            old->fsgid != new->fsgid ||
            !cap_issubset(new->cap_permitted, old->cap_permitted)) {
-               set_dumpable(task->mm, suid_dumpable);
+               if (task->mm)
+                       set_dumpable(task->mm, suid_dumpable);
                task->pdeath_signal = 0;
                smp_wmb();
        }
@@@ -506,7 -507,6 +507,7 @@@ struct cred *prepare_kernel_cred(struc
        else
                old = get_cred(&init_cred);
  
 +      *new = *old;
        get_uid(new->user);
        get_group_info(new->group_info);
  
  
  error:
        put_cred(new);
 +      put_cred(old);
        return NULL;
  }
  EXPORT_SYMBOL(prepare_kernel_cred);