Skip to content

Commit 7a9bc9e

Browse files
q2venkuba-moo
authored andcommitted
fou: Don't allow 0 for FOU_ATTR_IPPROTO.
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: 2346155 ("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>
1 parent 6857837 commit 7a9bc9e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Documentation/netlink/specs/fou.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ attribute-sets:
3939
-
4040
name: ipproto
4141
type: u8
42+
checks:
43+
min: 1
4244
-
4345
name: type
4446
type: u8

net/ipv4/fou_nl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
const struct nla_policy fou_nl_policy[FOU_ATTR_IFINDEX + 1] = {
1616
[FOU_ATTR_PORT] = { .type = NLA_BE16, },
1717
[FOU_ATTR_AF] = { .type = NLA_U8, },
18-
[FOU_ATTR_IPPROTO] = { .type = NLA_U8, },
18+
[FOU_ATTR_IPPROTO] = NLA_POLICY_MIN(NLA_U8, 1),
1919
[FOU_ATTR_TYPE] = { .type = NLA_U8, },
2020
[FOU_ATTR_REMCSUM_NOPARTIAL] = { .type = NLA_FLAG, },
2121
[FOU_ATTR_LOCAL_V4] = { .type = NLA_U32, },

0 commit comments

Comments
 (0)