]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: use kmalloc_array() for array space allocation
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Mon, 11 Aug 2025 12:58:16 +0000 (20:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:34:15 +0000 (16:34 +0200)
commit5e14e7060bb5b44956ad1eb9e37bfe28562284bb
tree598dbcadb46ef7fdf558676d47ed626688347ec9
parent2ea0fcc8878feefc83dba282405cd593177a16ea
ext4: use kmalloc_array() for array space allocation

commit 76dba1fe277f6befd6ef650e1946f626c547387a upstream.

Replace kmalloc(size * sizeof) with kmalloc_array() for safer memory
allocation and overflow prevention.

Cc: stable@kernel.org
Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Link: https://patch.msgid.link/20250811125816.570142-1-liaoyuanhong@vivo.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/orphan.c