diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2026-01-15 17:24:48 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-30 10:32:12 +0100 |
| commit | 9b75dff8446ec871030d8daf5a69e74f5fe8b956 (patch) | |
| tree | 3ca3e2ccebca069717e6d035645221ccaa41c31d /net/ipv4 | |
| parent | 18da5acb3c03d30263022095bf771d3c824ab67d (diff) | |
| download | linux-9b75dff8446ec871030d8daf5a69e74f5fe8b956.tar.gz linux-9b75dff8446ec871030d8daf5a69e74f5fe8b956.tar.bz2 linux-9b75dff8446ec871030d8daf5a69e74f5fe8b956.zip | |
fou: Don't allow 0 for FOU_ATTR_IPPROTO.
[ Upstream commit 7a9bc9e3f42391e4c187e099263cf7a1c4b69ff5 ]
fou_udp_recv() has the same problem mentioned in the previous
patch.
If FOU_ATTR_IPPROTO is set to 0, skb is not freed by
fou_udp_recv() nor "resubmit"-ted in ip_protocol_deliver_rcu().
Let's forbid 0 for FOU_ATTR_IPPROTO.
Fixes: 23461551c0062 ("fou: Support for foo-over-udp RX path")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260115172533.693652-4-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/ipv4')
| -rw-r--r-- | net/ipv4/fou_nl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/fou_nl.c b/net/ipv4/fou_nl.c index 506260b4a4dc..9ff7797ef7c4 100644 --- a/net/ipv4/fou_nl.c +++ b/net/ipv4/fou_nl.c @@ -14,7 +14,7 @@ const struct nla_policy fou_nl_policy[FOU_ATTR_IFINDEX + 1] = { [FOU_ATTR_PORT] = { .type = NLA_BE16, }, [FOU_ATTR_AF] = { .type = NLA_U8, }, - [FOU_ATTR_IPPROTO] = { .type = NLA_U8, }, + [FOU_ATTR_IPPROTO] = NLA_POLICY_MIN(NLA_U8, 1), [FOU_ATTR_TYPE] = { .type = NLA_U8, }, [FOU_ATTR_REMCSUM_NOPARTIAL] = { .type = NLA_FLAG, }, [FOU_ATTR_LOCAL_V4] = { .type = NLA_U32, }, |
