coredump: Proactively round up to kmalloc bucket size
authorKees Cook <keescook@chromium.org>
Tue, 20 Sep 2022 21:13:05 +0000 (14:13 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 1 Nov 2022 17:04:52 +0000 (10:04 -0700)
commit6dd142d9013ca82155d0c069434c60a0d5755ec0
tree730fa60fa3d9fde0b31ad8e9c5fc9d8ad3788545
parent905889bc6c842d18f369bf2834cf7219f32709ae
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>
fs/coredump.c