Skip to content

Commit 6a5e5a3

Browse files
committed
Merge branch 'fou-gue-fix-skb-memleak-with-inner-protocol-0'
Kuniyuki Iwashima says: ==================== fou/gue: Fix skb memleak with inner protocol 0. syzbot reported memleak for a GUE packet with its inner protocol number 0. Patch 1 fixes the issue, and patch 3 fixes the same issue in FOU. ==================== Link: https://patch.msgid.link/20260115172533.693652-1-kuniyu@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents ff77379 + 7a9bc9e commit 6a5e5a3

4 files changed

Lines changed: 7 additions & 2 deletions

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_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)
215215
return gue_control_message(skb, guehdr);
216216

217217
proto_ctype = guehdr->proto_ctype;
218+
if (unlikely(!proto_ctype))
219+
goto drop;
220+
218221
__skb_pull(skb, sizeof(struct udphdr) + hdrlen);
219222
skb_reset_transport_header(skb);
220223

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, },

tools/net/ynl/ynl-regen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ files=$(git grep --files-with-matches '^/\* YNL-GEN \(kernel\|uapi\|user\)')
2121
for f in $files; do
2222
# params: 0 1 2 3
2323
# $YAML YNL-GEN kernel $mode
24-
params=( $(git grep -B1 -h '/\* YNL-GEN' $f | sed 's@/\*\(.*\)\*/@\1@') )
24+
params=( $(git grep --no-line-number -B1 -h '/\* YNL-GEN' $f | sed 's@/\*\(.*\)\*/@\1@') )
2525
args=$(sed -n 's@/\* YNL-ARG \(.*\) \*/@\1@p' $f)
2626

2727
if [ $f -nt ${params[0]} -a -z "$force" ]; then

0 commit comments

Comments
 (0)