提交 87ea5843 编写于 作者: E Eric Biggers 提交者: James Morris

security: check for kstrdup() failure in lsm_append()

lsm_append() should return -ENOMEM if memory allocation failed.

Fixes: d69dece5 ("LSM: Add /sys/kernel/security/lsm")
Signed-off-by: NEric Biggers <ebiggers@google.com>
Signed-off-by: NJames Morris <james.morris@microsoft.com>
上级 83a68a06
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册