mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
apparmor: Fix memleak in alloc_ns()
After changes in commita1bd627b46
("apparmor: share profile name on replacement"), the hname member of struct aa_policy is not valid slab object, but a subset of that, it can not be freed by kfree_sensitive(), use aa_policy_destroy() to fix it. Fixes:a1bd627b46
("apparmor: share profile name on replacement") Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
committed by
John Johansen
parent
3265949f7c
commit
e9e6fa49db
@@ -132,7 +132,7 @@ static struct aa_ns *alloc_ns(const char *prefix, const char *name)
|
||||
return ns;
|
||||
|
||||
fail_unconfined:
|
||||
kfree_sensitive(ns->base.hname);
|
||||
aa_policy_destroy(&ns->base);
|
||||
fail_ns:
|
||||
kfree_sensitive(ns);
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user