devres: Use kmalloc_size_roundup() to match ksize() usage
authorKees Cook <keescook@chromium.org>
Tue, 18 Oct 2022 09:04:10 +0000 (02:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Nov 2022 14:11:46 +0000 (15:11 +0100)
commit6fcd7e702d3d91cc2c3194acffd7d67b2c10b81f
tree2999195a591838196586eba74b77b528510a0f5f
parent9e6002ad9e28209dcefa342977ac683779556dbd
devres: Use kmalloc_size_roundup() to match ksize() usage

Round up allocations with kmalloc_size_roundup() so that devres's use
of ksize() is always accurate and no special handling of the memory is
needed by KASAN, UBSAN_BOUNDS, nor FORTIFY_SOURCE.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221018090406.never.856-kees@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/devres.c