android_kernel_xiaomi_sm8350/security/keys
David Howells 664cceb009 [PATCH] Keys: Add possessor permissions to keys [try #3]
The attached patch adds extra permission grants to keys for the possessor of a
key in addition to the owner, group and other permissions bits. This makes
SUID binaries easier to support without going as far as labelling keys and key
targets using the LSM facilities.

This patch adds a second "pointer type" to key structures (struct key_ref *)
that can have the bottom bit of the address set to indicate the possession of
a key. This is propagated through searches from the keyring to the discovered
key. It has been made a separate type so that the compiler can spot attempts
to dereference a potentially incorrect pointer.

The "possession" attribute can't be attached to a key structure directly as
it's not an intrinsic property of a key.

Pointers to keys have been replaced with struct key_ref *'s wherever
possession information needs to be passed through.

This does assume that the bottom bit of the pointer will always be zero on
return from kmem_cache_alloc().

The key reference type has been made into a typedef so that at least it can be
located in the sources, even though it's basically a pointer to an undefined
type. I've also renamed the accessor functions to be more useful, and all
reference variables should now end in "_ref".

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-28 09:10:47 -07:00
..
compat.c [PATCH] Keys: Make request-key create an authorisation key 2005-06-24 00:05:19 -07:00
internal.h [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
key.c [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
keyctl.c [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
keyring.c [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
Makefile [PATCH] Keys: Make request-key create an authorisation key 2005-06-24 00:05:19 -07:00
proc.c [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
process_keys.c [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
request_key_auth.c [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
request_key.c [PATCH] Keys: Add possessor permissions to keys [try #3] 2005-09-28 09:10:47 -07:00
user_defined.c [PATCH] eCryptfs: export user key type 2005-06-24 00:05:19 -07:00