Skip to contentSkip to conversation

inet: shrink struct flowi_common

PATCH Applied Eric Dumazet 3 participants 3 messages Oct 25, 2023 – Nov 2, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 inet: shrink struct flowi_common

I am looking at syzbot reports triggering kernel stack overflows involving a cascade of ipvlan devices.

We can save 8 bytes in struct flowi_common.

This patch alone will not fix the issue, but is a start.

Fixes 24ba14406c5c ("route: Add multipath_hash in flowi_common to make user-define hash")
---
 include/net/flow.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/flow.h +1 -1
index 7f0adda3bf2fed28c53352d9021574b5eade2738..335bbc52171c10eb4b4b7e03a18eb8147902c6ac 100644
@@ -40,8 +40,8 @@ struct flowi_common {
 #define FLOWI_FLAG_KNOWN_NH		0x02
 	__u32	flowic_secid;
 	kuid_t  flowic_uid;
-	struct flowi_tunnel flowic_tun_key;
 	__u32		flowic_multipath_hash;
+	struct flowi_tunnel flowic_tun_key;
 };
 
 union flowi_uli {
Signature · 1 line
2.42.0.758.gaed0368e0e-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Eric Dumazet

I am looking at syzbot reports triggering kernel stack overflows involving a cascade of ipvlan devices.

We can save 8 bytes in struct flowi_common.

Quoted 9 lines

This patch alone will not fix the issue, but is a start.

Fixes 24ba14406c5c ("route: Add multipath_hash in flowi_common to make user-define hash")
---
 include/net/flow.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw
In reply to Eric Dumazet
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Wed, 25 Oct 2023 14:10:37 +0000 you wrote:

I am looking at syzbot reports triggering kernel stack overflows involving a cascade of ipvlan devices.

We can save 8 bytes in struct flowi_common.

This patch alone will not fix the issue, but is a start.

[...]

Here is the summary with links:
- [net] inet: shrink struct flowi_common

    https://git.kernel.org/netdev/net/c/1726483b79a7

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html