Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
KEYS: Permit key_serial() to be called with a const key pointer
keys: fix user_defined key sparse messages
ima: fix cred sparse warning
MPILIB: Add a missing ENOMEM check

+8 -5
+1 -1
include/linux/key.h
··· 271 271 272 272 extern struct key *key_lookup(key_serial_t id); 273 273 274 - static inline key_serial_t key_serial(struct key *key) 274 + static inline key_serial_t key_serial(const struct key *key) 275 275 { 276 276 return key ? key->serial : 0; 277 277 }
+2
lib/mpi/mpicoder.c
··· 255 255 if (!n) 256 256 n++; /* avoid zero length allocation */ 257 257 p = buffer = kmalloc(n, GFP_KERNEL); 258 + if (!p) 259 + return NULL; 258 260 259 261 for (i = a->nlimbs - 1; i >= 0; i--) { 260 262 alimb = a->d[i];
+2 -1
security/integrity/ima/ima_policy.c
··· 99 99 struct inode *inode, enum ima_hooks func, int mask) 100 100 { 101 101 struct task_struct *tsk = current; 102 + const struct cred *cred = current_cred(); 102 103 int i; 103 104 104 105 if ((rule->flags & IMA_FUNC) && rule->func != func) ··· 109 108 if ((rule->flags & IMA_FSMAGIC) 110 109 && rule->fsmagic != inode->i_sb->s_magic) 111 110 return false; 112 - if ((rule->flags & IMA_UID) && rule->uid != tsk->cred->uid) 111 + if ((rule->flags & IMA_UID) && rule->uid != cred->uid) 113 112 return false; 114 113 for (i = 0; i < MAX_LSM_RULES; i++) { 115 114 int rc = 0;
+3 -3
security/keys/user_defined.c
··· 59 59 /* attach the data */ 60 60 upayload->datalen = datalen; 61 61 memcpy(upayload->data, data, datalen); 62 - rcu_assign_pointer(key->payload.data, upayload); 62 + rcu_assign_keypointer(key, upayload); 63 63 ret = 0; 64 64 65 65 error: ··· 98 98 if (ret == 0) { 99 99 /* attach the new data, displacing the old */ 100 100 zap = key->payload.data; 101 - rcu_assign_pointer(key->payload.data, upayload); 101 + rcu_assign_keypointer(key, upayload); 102 102 key->expiry = 0; 103 103 } 104 104 ··· 133 133 key_payload_reserve(key, 0); 134 134 135 135 if (upayload) { 136 - rcu_assign_pointer(key->payload.data, NULL); 136 + rcu_assign_keypointer(key, NULL); 137 137 kfree_rcu(upayload, rcu); 138 138 } 139 139 }