openvswitch: Use kmalloc_size_roundup() to match ksize() usage
Subsystems (3)
PATCH 1/1 openvswitch: Use kmalloc_size_roundup() to match ksize() usage
Round up allocations with kmalloc_size_roundup() so that openvswitch's use of ksize() is always accurate and no special handling of the memory is needed by KASAN, UBSAN_BOUNDS, nor FORTIFY_SOURCE.
Cc Pravin B Shelar <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Paolo Abeni <[email protected]>
Signed-off-by Kees Cook <[email protected]>
--- net/openvswitch/flow_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/openvswitch/flow_netlink.c +1 -1
@@ -2309,7 +2309,7 @@ static struct sw_flow_actions *nla_alloc_flow_actions(int size)WARN_ON_ONCE (size >MAX_ACTIONS_BUFSIZE ); - sfa =kmalloc (sizeof (*sfa) + size,GFP_KERNEL ); + sfa =kmalloc (kmalloc_size_roundup (sizeof (*sfa) + size),GFP_KERNEL );if (!sfa)return ERR_PTR (-ENOMEM );
Signature · 1 line
2.34.1
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 13 lines · On Tue, 18 Oct 2022 02:06:33 -0700 you wrote:
Round up allocations with
kmalloc_size_roundup()so that openvswitch's use ofksize()is always accurate and no special handling of the memory is needed by KASAN,UBSAN_BOUNDS, norFORTIFY_SOURCE.Cc Pravin B Shelar <[email protected]>Cc "David S. Miller" <[email protected]>Cc Eric Dumazet <[email protected]>Cc Jakub Kicinski <[email protected]>Cc Paolo Abeni <[email protected]>Signed-off-by Kees Cook <[email protected]>
Quoted 1 line
[...]
Here is the summary with links:
- openvswitch: Use kmalloc_size_roundup() to match ksize() usage
https://git.kernel.org/netdev/net-next/c/ab3f7828c979
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html