]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lkdtm: fortify: Fix potential NULL dereference on kmalloc failure
authorJunjie Cao <junjie.cao@intel.com>
Thu, 14 Aug 2025 06:06:05 +0000 (14:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:04:36 +0000 (14:04 +0100)
commit85fdb41968d57150b2e3a5c86754bab8e75bd026
tree4eaf132ebabe3a66d9ea1faf8bbf409dc605447c
parent50699386d2043bfcc5ac30bb4c3ee91dd92184a2
lkdtm: fortify: Fix potential NULL dereference on kmalloc failure

[ Upstream commit 01c7344e21c2140e72282d9d16d79a61f840fc20 ]

Add missing NULL pointer checks after kmalloc() calls in
lkdtm_FORTIFY_STR_MEMBER() and lkdtm_FORTIFY_MEM_MEMBER() functions.

Signed-off-by: Junjie Cao <junjie.cao@intel.com>
Link: https://lore.kernel.org/r/20250814060605.5264-1-junjie.cao@intel.com
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/lkdtm/fortify.c