]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring
authorDavid Howells <dhowells@redhat.com>
Fri, 17 Jun 2011 10:25:59 +0000 (11:25 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 17 Jun 2011 16:40:48 +0000 (09:40 -0700)
commit1313a376477eacf72c2c21031f97ad81056a810e
tree9bff5392e365caf656c9dd9be38f7471c182278c
parent0784d09ce6b5438ebba41f4ec7dcb47435125e57
KEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring

____call_usermodehelper() now erases any credentials set by the
subprocess_inf::init() function.  The problem is that commit
7e5ae2a6c88d ("capabilites: allow the application of capability limits
to usermode helpers") creates and commits new credentials with
prepare_kernel_cred() after the call to the init() function.  This wipes
all keyrings after umh_keys_init() is called.

The best way to deal with this is to put the init() call just prior to
the commit_creds() call, and pass the cred pointer to init().  That
means that umh_keys_init() and suchlike can modify the credentials
_before_ they are published and potentially in use by the rest of the
system.

This prevents request_key() from working as it is prevented from passing
the session keyring it set up with the authorisation token to
/sbin/request-key, and so the latter can't assume the authority to
instantiate the key.  This causes the in-kernel DNS resolver to fail
with ENOKEY unconditionally.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Eric Paris <eparis@redhat.com>
Tested-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c
include/linux/kmod.h
kernel/kmod.c
security/keys/request_key.c