diff options
| author | Kevin Coffman <[email protected]> | 2008-04-29 08:01:22 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2008-04-29 15:06:16 +0000 |
| commit | dceba9944181b1fd5993417b5c8fa0e3dda38f8d (patch) | |
| tree | 697e247a7a99c81af7ba4d7ad5d9cdf9941b3741 /security/selinux/hooks.c | |
| parent | keys: increase the payload size when instantiating a key (diff) | |
| download | kernel-dceba9944181b1fd5993417b5c8fa0e3dda38f8d.tar.gz kernel-dceba9944181b1fd5993417b5c8fa0e3dda38f8d.zip | |
keys: check starting keyring as part of search
Check the starting keyring as part of the search to (a) see if that is what
we're searching for, and (b) to check it is still valid for searching.
The scenario: User in process A does things that cause things to be created in
its process session keyring. The user then does an su to another user and
starts a new process, B. The two processes now share the same process session
keyring.
Process B does an NFS access which results in an upcall to gssd. When gssd
attempts to instantiate the context key (to be linked into the process session
keyring), it is denied access even though it has an authorization key.
The order of calls is:
keyctl_instantiate_key()
lookup_user_key() (the default: case)
search_process_keyrings(current)
search_process_keyrings(rka->context) (recursive call)
keyring_search_aux()
keyring_search_aux() verifies the keys and keyrings underneath the top-level
keyring it is given, but that top-level keyring is neither fully validated nor
checked to see if it is the thing being searched for.
This patch changes keyring_search_aux() to:
1) do more validation on the top keyring it is given and
2) check whether that top-level keyring is the thing being searched for
Signed-off-by: Kevin Coffman <[email protected]>
Signed-off-by: David Howells <[email protected]>
Cc: Paul Moore <[email protected]>
Cc: Chris Wright <[email protected]>
Cc: Stephen Smalley <[email protected]>
Cc: James Morris <[email protected]>
Cc: Kevin Coffman <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: "J. Bruce Fields" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'security/selinux/hooks.c')
0 files changed, 0 insertions, 0 deletions
