diff options
| author | Shuai Liu <847807867@qq.com> | 2026-11-19 13:08:14 +0800 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-11-26 09:53:43 +0100 |
| commit | e509726660dd06ce107437aecf7c106c9d3fc1e7 (patch) | |
| tree | 7c3c3e32120d2e3519c01ce7ec3df6046d7cec88 /tools/perf/scripts/python | |
| parent | ef3e21c61baa74e39a49b75318bd4541562ec43f (diff) | |
xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
AF_XDP sockets bound to an xfrm interface submit skbs with
skb->protocol unset (0) and skb->network_header still 0 from the
__alloc_skb() zero-initialization; skb_reserve() only moves data
NET_SKB_PAD bytes into the headroom.
Since commit 86de3a1118a16 ("xfrm: interface: validate the IP header
on xmit"), xfrmi_xmit() calls pskb_inet_may_pull() unconditionally.
For such a skb, pskb_inet_may_pull_reason() selects nhlen = 0 for the
unknown protocol and pskb_may_pull_reason() receives
len = skb_network_offset(skb) = network_header - data = -64, which as
unsigned int exceeds INT_MAX and trips the
DEBUG_NET_WARN_ON_ONCE(len > INT_MAX) in pskb_may_pull_reason():
WARNING: ./include/linux/skbuff.h:2856 at pskb_may_pull_reason [inline]
WARNING: ./include/linux/skbuff.h:3286 at pskb_network_may_pull_reason [inline]
WARNING: ./include/net/ip_tunnels.h:483 at pskb_inet_may_pull_reason [inline]
WARNING: ./include/net/ip_tunnels.h:488 at pskb_inet_may_pull [inline]
WARNING: ./include/net/ip_tunnels.h:488 at xfrmi_xmit+0x1844/0x1eb0
net/xfrm/xfrm_interface_core.c:534
RIP: 0010:pskb_may_pull_reason include/linux/skbuff.h:2856 [inline]
Call Trace:
__dev_direct_xmit+0x4b6/0x730 net/core/dev.c:5164
__xsk_generic_xmit net/xdp/xsk.c:1288 [inline]
xsk_generic_xmit+0x27d8/0x47a0 net/xdp/xsk.c:1344
xsk_poll+0x326/0x670 net/xdp/xsk.c:1472
The packet is dropped by the pull returning PKT_TOO_SMALL and hitting
the default case afterwards anyway, so the only visible effect is the
warning; reject unknown protocols before the pull to restore the
pre-86de3a1118a16 behavior of dropping them silently via the switch
default.
Reported-by: syzbot+d29af9ef5c96a3f5e96c@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=d29af9ef5c96a3f5e96c
Fixes: 86de3a1118a16 ("xfrm: interface: validate the IP header on xmit")
Cc: stable@vger.kernel.org
Signed-off-by: Shuai Liu <847807867@qq.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Link: https://patch.msgid.link/tencent_46F20906773869221623F9FA26275C133107@qq.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
