coredump: Proactively round up to kmalloc bucket size
JIRA: https://issues.redhat.com/browse/RHEL-44555
This patch is a backport of the following upstream commit:
commit 6dd142d9013ca82155d0c069434c60a0d5755ec0
Author: Kees Cook keescook@chromium.org
Date: Tue Sep 20 14:13:05 2022 -0700
coredump: Proactively round up to kmalloc bucket size
Instead of discovering the kmalloc bucket size _after_ allocation, round
up proactively so the allocation is explicitly made for the full size,
allowing the compiler to correctly reason about the resulting size of
the buffer through the existing __alloc_size() hint.
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Audra Mitchell audra@redhat.com