Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9456371 authored by David Howells's avatar David Howells Committed by James Morris
Browse files

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: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 9e42d0cf
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -372,6 +372,7 @@ int commit_creds(struct cred *new)
	    old->fsuid != new->fsuid ||
	    old->fsgid != new->fsgid ||
	    !cap_issubset(new->cap_permitted, old->cap_permitted)) {
		if (task->mm)
			set_dumpable(task->mm, suid_dumpable);
		task->pdeath_signal = 0;
		smp_wmb();