projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83a68a0
)
security: check for kstrdup() failure in lsm_append()
author
Eric Biggers
<ebiggers@google.com>
Tue, 17 Jul 2018 17:36:04 +0000
(10:36 -0700)
committer
James Morris
<james.morris@microsoft.com>
Wed, 18 Jul 2018 04:27:06 +0000
(21:27 -0700)
lsm_append() should return -ENOMEM if memory allocation failed.
Fixes:
d69dece5f5b6
("LSM: Add /sys/kernel/security/lsm")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
security/security.c
patch
|
blob
|
history
diff --git
a/security/security.c
b/security/security.c
index
6e149d0
..
b49ee81
100644
(file)
--- a/
security/security.c
+++ b/
security/security.c
@@
-118,6
+118,8
@@
static int lsm_append(char *new, char **result)
if (*result == NULL) {
*result = kstrdup(new, GFP_KERNEL);
+ if (*result == NULL)
+ return -ENOMEM;
} else {
/* Check if it is the last registered name */
if (match_last_lsm(*result, new))