linux/security/apparmor
Xiu Jianfeng 8aab429558 apparmor: Fix memleak in aa_simple_write_to_buffer()
commit 417ea9fe97 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:37:53 +02:00
..
include apparmor: fix overlapping attachment computation 2022-08-25 11:37:53 +02:00
.gitignore
apparmorfs.c apparmor: Fix memleak in aa_simple_write_to_buffer() 2022-08-25 11:37:53 +02:00
audit.c apparmor: fix quiet_denied for file rules 2022-08-25 11:37:51 +02:00
capability.c
crypto.c
domain.c apparmor: fix overlapping attachment computation 2022-08-25 11:37:53 +02:00
file.c audit: purge audit_log_string from the intra-kernel audit API 2020-07-21 11:12:31 -04:00
ipc.c audit: purge audit_log_string from the intra-kernel audit API 2020-07-21 11:12:31 -04:00
Kconfig Minor fixes for v5.9. 2020-08-11 14:30:36 -07:00
label.c apparmor: fix aa_label_asxprint return check 2022-08-25 11:37:52 +02:00
lib.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
lsm.c Tag summary 2020-06-07 16:04:49 -07:00
Makefile
match.c
mount.c apparmor: fix reference count leak in aa_pivotroot() 2022-08-25 11:37:53 +02:00
net.c audit: purge audit_log_string from the intra-kernel audit API 2020-07-21 11:12:31 -04:00
nulldfa.in
path.c
policy_ns.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
policy_unpack_test.c
policy_unpack.c apparmor: fix setting unconfined mode on a loaded profile 2022-08-25 11:37:52 +02:00
policy.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
procattr.c
resource.c
secid.c
stacksplitdfa.in
task.c