bnx2: Use kmalloc_size_roundup() to match ksize() usage
authorKees Cook <keescook@chromium.org>
Sat, 22 Oct 2022 02:10:47 +0000 (19:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:59 +0000 (13:32 +0100)
commit6cfa68c7d2ce500cecde5b13e77cb1fafddf2b21
treed5201f9445d0c2aa1e1b965e7e0abeb649ba15c7
parentbde272c8758dc379b65d05a05fc048b3ae98498e
bnx2: Use kmalloc_size_roundup() to match ksize() usage

[ Upstream commit d6dd508080a3cdc0ab34ebf66c3734f2dff907ad ]

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

Cc: Rasesh Mody <rmody@marvell.com>
Cc: GR-Linux-NIC-Dev@marvell.com
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221022021004.gonna.489-kees@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnx2.c