kernel BUG in __pskb_pull_tail (2)

Status: upstream: reported C repro on 2026/10/29 23:21
Subsystems: sctp
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+f15a6eff7a53f6eb7dc3@syzkaller.appspotmail.com
First crash: 13d, last: 19h56m
Cause bisection: failed (error log, bisect log)
  
✨ AI-generated root cause summary:

When receiving an SCTP packet that is nonlinear (such as an SCTP GSO packet constructed with fragments in frag_list), sctp_rcv attempts to linearize the packet using skb_linearize() if the sk_buff is cloned (e.g., tapped by a packet socket or shared) or not recognized as GSO. During linearization via __skb_linearize() and __pskb_pull_tail(), skb_copy_bits() fails with -EFAULT due to a discrepancy in frag_list fragment lengths or readable offsets, triggering a BUG_ON assertion failure. In production builds, this BUG() results in an invalid opcode oops and kernel panic, causing an immediate denial of service.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit 21a7f44fd076:

Detailed Technical Analysis

1. Crash Manifestation and Context

The kernel crashes with an invalid opcode Oops (0f 0b) at net/core/skbuff.c:2903 inside __pskb_pull_tail():

BUG_ON(skb_copy_bits(skb, skb_headlen(skb),
                     skb_tail_pointer(skb), delta));

In the crash report, register RBX (and R10) holds 0xffffff2 (-14 = -EFAULT), indicating that skb_copy_bits() returned -EFAULT. Because __pskb_pull_tail() asserts that copying the tail bits into the newly allocated/expanded head buffer must succeed, this assertion failure triggers BUG().

The stack trace reveals two coupled paths during a local SCTP transmission:

  1. Transmit / Egress Path (<TASK>):

    • User space issues a sendmmsg() syscall on an SCTP socket.
    • SCTP constructs an outgoing packet via sctp_packet_pack() (net/sctp/output.c), which configures SCTP GSO (GSO_BY_FRAGS) where individual data chunks are placed in chained sk_buff structures linked in skb_shinfo(head)->frag_list.
    • The packet is transmitted via loopback/veth (dev_queue_xmit()), which queues the packet into the per-CPU backlog queue and returns.
    • On exit from dev_queue_xmit(), rcu_read_unlock_bh() / local_bh_enable() triggers pending softirqs.
  2. Receive / Ingress Path (<IRQ>):

    • Softirq processing (net_rx_action() -> process_backlog()) passes the packet to IPv4 receive (ip_rcv() -> ip_local_deliver_finish()).
    • The IPv4 layer pulls the IP header via __skb_pull(skb, skb_network_header_len(skb)) and invokes sctp_rcv() (net/sctp/input.c:120).

2. Root Cause Analysis

In sctp_rcv() (net/sctp/input.c:120):

bool is_gso = skb_is_gso(skb) && skb_is_gso_sctp(skb);
...
if (((!is_gso || skb_cloned(skb)) && skb_linearize(skb)) ||
    !pskb_may_pull(skb, sizeof(struct sctphdr)))
	goto discard_it;
  • If the received skb is an SCTP GSO packet (which stores its chunks in skb_shinfo(skb)->frag_list), but happens to be cloned (for example, by a packet sniffer/tap via dev_queue_xmit_nit or skb_share_check), or if GSO flags were cleared or not set, sctp_rcv() attempts to linearize the entire buffer using skb_linearize(skb).
  • skb_linearize() invokes __skb_linearize(), which in turn calls __pskb_pull_tail(skb, skb->data_len).
  • In __pskb_pull_tail(skb, delta):
    1. pskb_expand_head(skb, ...) is called to reallocate head room because skb_cloned(skb) is true. During this expansion, skb_clone_fraglist(skb) is called to reference the fragments.
    2. skb_copy_bits(skb, skb_headlen(skb), skb_tail_pointer(skb), delta) is executed to pull all data_len bytes into the newly contiguous head buffer.
    3. skb_copy_bits() traverses skb_shinfo(skb)->frag_list. If there is a length mismatch or fragmentation geometry inconsistency (e.g. cumulative lengths in frag_list being shorter than skb->data_len, or recursive fragment bounds checks failing), skb_copy_bits() does not complete all len bytes and jumps to fault: return -EFAULT;.
    4. __pskb_pull_tail hits BUG_ON(...) on receiving -EFAULT.

3. Verification & Inconclusive Points

  • Verified:
    • __pskb_pull_tail() executes BUG_ON(skb_copy_bits(...)) because skb_copy_bits() returned -EFAULT.
    • The calling context is sctp_rcv() calling skb_linearize(skb).
    • In a standard production kernel without debug sanitizers, BUG_ON() triggers an invalid opcode trap (ud2), halting the system.
  • Inconclusive / Caveats:
    • The precise event that introduced the geometry discrepancy between skb->data_len and the frag_list lengths could not be definitively isolated (candidate triggers include interaction between network header stripping and linearization, packet trimming via pskb_trim_rcsum in the IP layer, or cloned frag_list state handling during pskb_expand_head).

4. Classification & Impact Assessment

  • RootCauseSummary: When receiving a nonlinear SCTP packet (such as an SCTP GSO packet using frag_list), sctp_rcv() attempts to linearize the packet with skb_linearize() if it is cloned or not recognized as GSO. In __pskb_pull_tail(), skb_copy_bits() fails with -EFAULT due to a mismatch between data_len and the fragment list, triggering a BUG_ON() panic.
  • RootCauseFiles: net/sctp/input.c, net/core/skbuff.c
  • MemoryCorruption: false (the check fails cleanly before any illegal memory write; the panic is due to an explicit BUG_ON() assertion).
  • InfoLeak: "none" (no kernel memory is disclosed).
  • RawDenialOfService: true (BUG_ON() unconditionally panics the kernel on production builds).
  • IsNetCandidate: true (networking stack, SCTP, and core skbuff).
  • IsKVMCandidate: false (no relation to KVM/hypervisors).
▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
6c15f307 repro-c 💥 kernel BUG in __pskb_pull_tail (2) 2026/10/28 15:12 2026/10/28 15:12 2026/10/29 07:43 b1d00f76
050a30cf assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ✅ UserNamespace: ✅ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ kernel BUG in __pskb_pull_tail (2) 2026/10/27 01:50 2026/10/27 01:50 2026/10/27 03:41 168cb7a2
▶ ▼ Discussions (2)
Title Replies (including bot) Last reply
[PATCH net] sctp: linearize GSO skb when frag_list skbs are shared 1 (1) 2026/11/05 18:21
[syzbot] [sctp?] kernel BUG in __pskb_pull_tail (2) 1 (5) 2026/11/05 03:13
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG in __pskb_pull_tail tipc -1 syz, C done 13 688d 695d 28/29 fixed on 2025/05/06 15:33
upstream kernel BUG in pskb_expand_head net -1 syz, C done 1600 1367d 1818d 22/29 fixed on 2023/02/25 08:02
▶ ▼ Last patch testing requests (2)
Created Duration User Patch Repo Result
2026/11/04 14:37 6m gowtham398gs@gmail.com patch upstream error job log
2026/11/04 10:49 13m gowtham398gs@gmail.com patch upstream report job log log

Sample crash report:
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:2903!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 2 UID: 0 PID: 6002 Comm: syz.0.20 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:__pskb_pull_tail+0x1335/0x1920 net/core/skbuff.c:2903
Code: 5b f8 48 89 df e8 2b 03 fe ff 31 ff 41 89 c4 89 c6 e8 7f 58 5b f8 45 84 e4 0f 84 1c f2 ff ff e9 84 f2 ff ff e8 5c 5e 5b f8 90 <0f> 0b e8 54 5e 5b f8 48 8b 54 24 30 48 b8 00 00 00 00 00 fc ff df
RSP: 0018:ffffc90000648870 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00000000fffffff2 RCX: 0000000000000101
RDX: ffff88802ce60000 RSI: ffffffff89b30684 RDI: 0000000000000005
RBP: ffffc900006488f0 R08: 0000000000000000 R09: 00000000fffffff2
R10: ffff888046a12f77 R11: 0000000000000000 R12: 00000000000000e4
R13: 0000000000000180 R14: 0000000000000000 R15: ffff888030406780
FS:  000055558120b500(0000) GS:ffff8880d467c000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000020000001a000 CR3: 00000000385f5000 CR4: 0000000000352ef0
Call Trace:
 <IRQ>
 __skb_linearize include/linux/skbuff.h:4025 [inline]
 skb_linearize include/linux/skbuff.h:4037 [inline]
 sctp_rcv+0x143e/0x3cc0 net/sctp/input.c:120
 ip_protocol_deliver_rcu+0x44c/0x4d0 net/ipv4/ip_input.c:207
 ip_local_deliver_finish+0x3fb/0x6e0 net/ipv4/ip_input.c:241
 NF_HOOK include/linux/netfilter.h:325 [inline]
 NF_HOOK include/linux/netfilter.h:319 [inline]
 ip_local_deliver+0x1a3/0x200 net/ipv4/ip_input.c:262
 dst_input include/net/dst.h:481 [inline]
 ip_rcv_finish net/ipv4/ip_input.c:492 [inline]
 NF_HOOK include/linux/netfilter.h:325 [inline]
 NF_HOOK include/linux/netfilter.h:319 [inline]
 ip_rcv+0x33a/0x3c0 net/ipv4/ip_input.c:612
 __netif_receive_skb_one_core+0x197/0x1e0 net/core/dev.c:6433
 __netif_receive_skb+0x1f/0x120 net/core/dev.c:6546
 process_backlog+0x487/0x1600 net/core/dev.c:6897
 __napi_poll.constprop.0+0xaf/0x450 net/core/dev.c:7966
 napi_poll net/core/dev.c:8029 [inline]
 net_rx_action+0xa40/0xf20 net/core/dev.c:8186
 handle_softirqs+0x216/0xa20 kernel/softirq.c:669
 do_softirq kernel/softirq.c:569 [inline]
 do_softirq+0xaf/0xf0 kernel/softirq.c:556
 </IRQ>
 <TASK>
 __local_bh_enable_ip+0xff/0x120 kernel/softirq.c:473
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 ipt_do_table+0xd71/0x1b10 net/ipv4/netfilter/ip_tables.c:357
 nf_hook_entry_hookfn include/linux/netfilter.h:165 [inline]
 nf_hook_slow+0xbf/0x220 net/netfilter/core.c:633
 nf_hook include/linux/netfilter.h:280 [inline]
 __ip_local_out+0x541/0xb80 net/ipv4/ip_output.c:120
 ip_local_out+0x2a/0x1f0 net/ipv4/ip_output.c:129
 __ip_queue_xmit+0x876/0x1f50 net/ipv4/ip_output.c:533
 sctp_v4_xmit+0x91a/0x1070 net/sctp/protocol.c:1061
 sctp_packet_transmit+0x22fe/0x30b0 net/sctp/output.c:659
 sctp_outq_flush_transports net/sctp/outqueue.c:1174 [inline]
 sctp_outq_flush+0xb2b/0x3380 net/sctp/outqueue.c:1222
 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1826 [inline]
 sctp_side_effects net/sctp/sm_sideeffect.c:1211 [inline]
 sctp_do_sm+0xce1/0x5c30 net/sctp/sm_sideeffect.c:1182
 sctp_assoc_bh_rcv+0x392/0x740 net/sctp/associola.c:1048
 sctp_inq_push+0x25c/0x320 net/sctp/inqueue.c:91
 sctp_backlog_rcv+0x169/0x590 net/sctp/input.c:331
 sk_backlog_rcv include/net/sock.h:1194 [inline]
 __release_sock+0x39d/0x440 net/core/sock.c:3341
 release_sock+0x1e5/0x280 net/core/sock.c:3940
 sctp_sendmsg+0x1166/0x22e0 net/sctp/socket.c:2091
 inet_sendmsg+0x11c/0x140 net/ipv4/af_inet.c:864
 sock_sendmsg_nosec net/socket.c:800 [inline]
 __sock_sendmsg net/socket.c:818 [inline]
 ____sys_sendmsg+0xa23/0xc30 net/socket.c:2715
 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2769
 __sys_sendmmsg+0x20c/0x440 net/socket.c:2858
 __do_sys_sendmmsg net/socket.c:2885 [inline]
 __se_sys_sendmmsg net/socket.c:2882 [inline]
 __x64_sys_sendmmsg+0x9c/0x100 net/socket.c:2882
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff80879fb19
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff70bcd848 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007ff808a25fa0 RCX: 00007ff80879fb19
RDX: 0000000000000001 RSI: 0000200000000e40 RDI: 0000000000000004
RBP: 00007ff808837b70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ff808a25fac R14: 00007ff808a25fa0 R15: 00007ff808a25fa0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__pskb_pull_tail+0x1335/0x1920 net/core/skbuff.c:2903
Code: 5b f8 48 89 df e8 2b 03 fe ff 31 ff 41 89 c4 89 c6 e8 7f 58 5b f8 45 84 e4 0f 84 1c f2 ff ff e9 84 f2 ff ff e8 5c 5e 5b f8 90 <0f> 0b e8 54 5e 5b f8 48 8b 54 24 30 48 b8 00 00 00 00 00 fc ff df
RSP: 0018:ffffc90000648870 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 00000000fffffff2 RCX: 0000000000000101
RDX: ffff88802ce60000 RSI: ffffffff89b30684 RDI: 0000000000000005
RBP: ffffc900006488f0 R08: 0000000000000000 R09: 00000000fffffff2
R10: ffff888046a12f77 R11: 0000000000000000 R12: 00000000000000e4
R13: 0000000000000180 R14: 0000000000000000 R15: ffff888030406780
FS:  000055558120b500(0000) GS:ffff8880d467c000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000020000001a000 CR3: 00000000385f5000 CR4: 0000000000352ef0

Crashes (18):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/04 05:02 upstream 05441d697f7f 5af5b6c6 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in __pskb_pull_tail
2026/11/04 08:04 net 787268686c64 5af5b6c6 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce kernel BUG in __pskb_pull_tail
2026/11/04 09:44 net-next 7b6ab4dbc156 5af5b6c6 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce kernel BUG in __pskb_pull_tail
2026/11/07 03:26 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/07 03:26 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/07 03:25 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/07 03:25 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/07 03:21 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/06 23:34 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/06 23:31 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/06 23:31 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/06 23:28 upstream f66469d9905b 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel BUG in __pskb_pull_tail
2026/11/04 02:52 upstream 05441d697f7f 5af5b6c6 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in __pskb_pull_tail
2026/11/04 02:40 upstream 05441d697f7f 5af5b6c6 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in __pskb_pull_tail
2026/11/04 02:35 upstream 05441d697f7f 5af5b6c6 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in __pskb_pull_tail
2026/10/25 23:14 upstream 21a7f44fd076 1d9ca40b .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in __pskb_pull_tail
2026/10/31 02:56 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7a19f0cc94ad 0ec395f8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in __pskb_pull_tail
2026/10/28 21:29 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7a19f0cc94ad 858db2ec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 kernel BUG in __pskb_pull_tail
* Struck through repros no longer work on HEAD.