projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a1a0206
)
apparmor: Fix aa_label_build() error handling for failed merges
author
John Johansen
<john.johansen@canonical.com>
Thu, 24 Jan 2019 21:53:05 +0000
(13:53 -0800)
committer
John Johansen
<john.johansen@canonical.com>
Fri, 1 Feb 2019 16:01:39 +0000
(08:01 -0800)
aa_label_merge() can return NULL for memory allocations failures
make sure to handle and set the correct error in this case.
Reported-by: Peng Hao <peng.hao2@zte.com.cn>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/domain.c
patch
|
blob
|
history
diff --git
a/security/apparmor/domain.c
b/security/apparmor/domain.c
index 08c88de0ffdadcb4d68450cff103408cba3a7746..11975ec8d5665957d145ae67f31a03bb41fc77e4 100644
(file)
--- a/
security/apparmor/domain.c
+++ b/
security/apparmor/domain.c
@@
-1444,7
+1444,10
@@
check:
new = aa_label_merge(label, target, GFP_KERNEL);
if (IS_ERR_OR_NULL(new)) {
info = "failed to build target label";
- error = PTR_ERR(new);
+ if (!new)
+ error = -ENOMEM;
+ else
+ error = PTR_ERR(new);
new = NULL;
perms.allow = 0;
goto audit;