diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-02 13:22:18 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-02 13:22:18 -0800 |
commit | 0f221a3102bba2d982d01bad38eb68507c343830 (patch) | |
tree | e46abcc1e415b912fadecc2cfc71db814e97894d /include/linux | |
parent | 4f1f2b8f0818af9b0e21ba4b17ab615e29b4650d (diff) | |
parent | 2651225b5ebcdde60f684c4db8ec7e9e3800a74f (diff) | |
download | talos-obmc-linux-0f221a3102bba2d982d01bad38eb68507c343830.tar.gz talos-obmc-linux-0f221a3102bba2d982d01bad38eb68507c343830.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem fixes from James Morris:
"Two fixes for the security subsystem:
- keys: split both rcu_dereference_key() and user_key_payload() into
versions which can be called with or without holding the key
semaphore.
- SELinux: fix Android init(8) breakage due to new cgroup security
labeling support when using older policy"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
selinux: wrap cgroup seclabel support with its own policy capability
KEYS: Differentiate uses of rcu_dereference_key() and user_key_payload()
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/key.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/key.h b/include/linux/key.h index 722914798f37..e45212f2777e 100644 --- a/include/linux/key.h +++ b/include/linux/key.h @@ -354,7 +354,10 @@ static inline bool key_is_instantiated(const struct key *key) !test_bit(KEY_FLAG_NEGATIVE, &key->flags); } -#define rcu_dereference_key(KEY) \ +#define dereference_key_rcu(KEY) \ + (rcu_dereference((KEY)->payload.rcu_data0)) + +#define dereference_key_locked(KEY) \ (rcu_dereference_protected((KEY)->payload.rcu_data0, \ rwsem_is_locked(&((struct key *)(KEY))->sem))) |