]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: Use struct_size() helper in kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 29 Sep 2021 22:05:26 +0000 (17:05 -0500)
committerJohn Johansen <john.johansen@canonical.com>
Wed, 3 Nov 2021 22:57:19 +0000 (15:57 -0700)
commit1e2ef1cabaeba61d61757dd9ddcad33faa672756
tree16fb63da1fc76313944707c9be9061f218f81c3c
parent78306a11c44cfa0c454ba8c3086c31af5d9dd77c
apparmor: Use struct_size() helper in kzalloc()

Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worse scenario, could lead to heap overflows.

Link: https://github.com/KSPP/linux/issues/160
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/label.c
security/apparmor/policy.c