diff options
author | David Howells <dhowells@redhat.com> | 2009-01-08 06:18:31 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-01-08 07:13:56 -0500 |
commit | b9456371a73871d001e67b5f4eac118c2c278e1c (patch) | |
tree | 1bfe87d83dc3d7f34b9d7edf9a9ef3a693afcf29 /kernel/cred.c | |
parent | 9e42d0cf5020aaf217433cad1a224745241d212a (diff) |
CRED: Fix commit_creds() on a process that has no mm
Fix commit_creds()'s handling of a process that has no mm (such as one that is
calling or has called daemonize()). commit_creds() should check to see if
task->mm is not NULL before calling set_dumpable() on it.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel/cred.c')
-rw-r--r-- | kernel/cred.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/cred.c b/kernel/cred.c index ff7bc071991..480a61aec80 100644 --- a/kernel/cred.c +++ b/kernel/cred.c | |||
@@ -372,7 +372,8 @@ int commit_creds(struct cred *new) | |||
372 | old->fsuid != new->fsuid || | 372 | old->fsuid != new->fsuid || |
373 | old->fsgid != new->fsgid || | 373 | old->fsgid != new->fsgid || |
374 | !cap_issubset(new->cap_permitted, old->cap_permitted)) { | 374 | !cap_issubset(new->cap_permitted, old->cap_permitted)) { |
375 | set_dumpable(task->mm, suid_dumpable); | 375 | if (task->mm) |
376 | set_dumpable(task->mm, suid_dumpable); | ||
376 | task->pdeath_signal = 0; | 377 | task->pdeath_signal = 0; |
377 | smp_wmb(); | 378 | smp_wmb(); |
378 | } | 379 | } |