Commit dfdd999a authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

UPSTREAM: mm: vmalloc: only zero-init on vrealloc shrink

commit 70d1eb03 upstream.

The common case is to grow reallocations, and since init_on_alloc will
have already zeroed the whole allocation, we only need to zero when
shrinking the allocation.

Link: https://lkml.kernel.org/r/20250515214217.619685-2-kees@kernel.org


Fixes: a0309faf ("mm: vmalloc: support more granular vrealloc() sizing")
Signed-off-by: default avatarKees Cook <kees@kernel.org>
Tested-by: default avatarPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: "Erhard F." <erhard_f@mailbox.org>
Cc: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 483ac741)
Bug: 437846539
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia7425516241bb2a1a34a3b7581b5bd9331356be3
parent 7eec06fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment