From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+bfde3bef047a81b8fde6@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] KASAN: use-after-free Read in __skb_flow_dissect (3)
Date: Fri, 19 Jan 2024 18:31:04 +0800 [thread overview]
Message-ID: <20240119103104.1990-1-hdanton@sina.com> (raw)
In-Reply-To: <000000000000498a02060de59162@google.com>
On Mon, 01 Jan 2024 09:18:16 -0800
> syzbot found the following issue on:
>
> HEAD commit: f5837722ffec Merge tag 'mm-hotfixes-stable-2023-12-27-15-0..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=122dfc65e80000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
--- x/net/core/filter.c
+++ y/net/core/filter.c
@@ -2161,6 +2161,10 @@ static int __bpf_redirect_no_mac(struct
}
skb_pop_mac_header(skb);
skb_reset_mac_len(skb);
+
+ if (skb->data[0] < 2)
+ flags = 0;
+
return flags & BPF_F_INGRESS ?
__bpf_rx_skb_no_mac(dev, skb) : __bpf_tx_skb(dev, skb);
}
--- x/net/ipv4/ipip.c
+++ y/net/ipv4/ipip.c
@@ -281,6 +281,9 @@ static netdev_tx_t ipip_tunnel_xmit(stru
if (!pskb_inet_may_pull(skb))
goto tx_error;
+ if (skb->data[0] < 2)
+ DEV_STATS_INC(dev, tx_errors);
+
switch (skb->protocol) {
case htons(ETH_P_IP):
ipproto = IPPROTO_IPIP;
@@ -302,6 +305,9 @@ static netdev_tx_t ipip_tunnel_xmit(stru
skb_set_inner_ipproto(skb, ipproto);
+ if (skb->data[0] < 2)
+ DEV_STATS_INC(dev, tx_errors);
+
if (tunnel->collect_md)
ip_md_tunnel_xmit(skb, dev, ipproto, 0);
else
--- x/net/ipv4/ip_tunnel.c
+++ y/net/ipv4/ip_tunnel.c
@@ -745,6 +745,9 @@ void ip_tunnel_xmit(struct sk_buff *skb,
}
}
+ if (skb->data[0] < 2)
+ DEV_STATS_INC(dev, tx_errors);
+
ip_tunnel_init_flow(&fl4, protocol, dst, tnl_params->saddr,
tunnel->parms.o_key, RT_TOS(tos),
dev_net(dev), tunnel->parms.link,
@@ -828,6 +831,9 @@ void ip_tunnel_xmit(struct sk_buff *skb,
return;
}
+ if (skb->data[0] < 2)
+ DEV_STATS_INC(dev, tx_errors);
+
iptunnel_xmit(NULL, rt, skb, fl4.saddr, fl4.daddr, protocol, tos, ttl,
df, !net_eq(tunnel->net, dev_net(dev)));
return;
--
next prev parent reply other threads:[~2024-01-19 10:31 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-01 17:18 syzbot
2024-01-17 11:23 ` Hillf Danton
2024-01-17 11:58 ` syzbot
2024-01-17 13:14 ` Hillf Danton
2024-01-17 13:35 ` syzbot
2024-01-17 22:51 ` Hillf Danton
2024-01-17 23:16 ` syzbot
2024-01-17 23:43 ` Hillf Danton
2024-01-18 0:18 ` syzbot
2024-01-18 2:33 ` Hillf Danton
2024-01-18 2:55 ` syzbot
2024-01-18 4:33 ` Hillf Danton
2024-01-18 4:47 ` syzbot
2024-01-18 11:17 ` Hillf Danton
2024-01-18 11:47 ` syzbot
2024-01-18 12:08 ` Hillf Danton
2024-01-18 12:31 ` syzbot
2024-01-18 13:17 ` Hillf Danton
2024-01-18 13:40 ` syzbot
2024-01-18 22:15 ` Hillf Danton
2024-01-18 22:34 ` syzbot
2024-01-19 4:49 ` Hillf Danton
2024-01-19 5:22 ` syzbot
2024-01-19 7:38 ` Hillf Danton
2024-01-19 8:01 ` syzbot
2024-01-19 10:31 ` Hillf Danton [this message]
2024-01-19 10:47 ` syzbot
2024-01-19 11:47 ` Hillf Danton
2024-01-19 12:07 ` syzbot
2024-02-20 13:05 ` [syzbot] KASAN: use-after-free Read in __skb_flow_dissect syzbot
[not found] <20240220130510.GC19387@breakpoint.cc>
2024-02-20 13:27 ` [syzbot] [net?] KASAN: use-after-free Read in __skb_flow_dissect (3) syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240119103104.1990-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+bfde3bef047a81b8fde6@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®