android_kernel_xiaomi_sm7250/security/apparmor
Xiu Jianfeng 6500eb3a48 apparmor: Fix memleak in aa_simple_write_to_buffer()
commit 417ea9fe972d2654a268ad66e89c8fcae67017c3 upstream.

When copy_from_user failed, the memory is freed by kvfree. however the
management struct and data blob are allocated independently, so only
kvfree(data) cause a memleak issue here. Use aa_put_loaddata(data) to
fix this issue.

Fixes: a6a52579e5 ("apparmor: split load data into management struct and data blob")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-25 11:15:36 +02:00
..
include apparmor: fix overlapping attachment computation 2022-08-25 11:15:36 +02:00
.gitignore
apparmorfs.c apparmor: Fix memleak in aa_simple_write_to_buffer() 2022-08-25 11:15:36 +02:00
audit.c apparmor: fix quiet_denied for file rules 2022-08-25 11:15:35 +02:00
capability.c
crypto.c
domain.c apparmor: fix overlapping attachment computation 2022-08-25 11:15:36 +02:00
file.c
ipc.c
Kconfig
label.c apparmor: fix aa_label_asxprint return check 2022-08-25 11:15:36 +02:00
lib.c
lsm.c
Makefile
match.c
mount.c apparmor: fix reference count leak in aa_pivotroot() 2022-08-25 11:15:36 +02:00
net.c
nulldfa.in
path.c
policy_ns.c
policy_unpack.c
policy.c
procattr.c
resource.c
secid.c
stacksplitdfa.in
task.c