In the Linux kernel, the following vulnerability has been resolved:
netsched: fix NULL deref in fifoset_limit()
syzbot reported another NULL deref in fifosetlimit() [1]
I could repro the issue with :
unshare -n tc qd add dev lo root handle 1:0 tbf limit 200000 burst 70000 rate 100Mbit tc qd replace dev lo parent 1:0 pfifo_fast tc qd change dev lo root handle 1:0 tbf limit 300000 burst 70000 rate 100Mbit
pfifofast does not have a change() operation. Make fifoset_limit() more robust about this.
[1] BUG: kernel NULL pointer dereference, address: 0000000000000000 PGD 1cf99067 P4D 1cf99067 PUD 7ca49067 PMD 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 1 PID: 14443 Comm: syz-executor959 Not tainted 5.15.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:0x0 Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. RSP: 0018:ffffc9000e2f7310 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffffffff8d6ecc00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff888024c27910 RDI: ffff888071e34000 RBP: ffff888071e34000 R08: 0000000000000001 R09: ffffffff8fcfb947 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888024c27910 R13: ffff888071e34018 R14: 0000000000000000 R15: ffff88801ef74800 FS: 00007f321d897700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000000722c3000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: fifosetlimit net/sched/schfifo.c:242 [inline] fifosetlimit+0x198/0x210 net/sched/schfifo.c:227 tbfchange+0x6ec/0x16d0 net/sched/schtbf.c:418 qdiscchange net/sched/schapi.c:1332 [inline] tcmodifyqdisc+0xd9a/0x1a60 net/sched/schapi.c:1634 rtnetlinkrcvmsg+0x413/0xb80 net/core/rtnetlink.c:5572 netlinkrcvskb+0x153/0x420 net/netlink/afnetlink.c:2504 netlinkunicastkernel net/netlink/afnetlink.c:1314 [inline] netlinkunicast+0x533/0x7d0 net/netlink/afnetlink.c:1340 netlinksendmsg+0x86d/0xdb0 net/netlink/afnetlink.c:1929 socksendmsgnosec net/socket.c:704 [inline] socksendmsg+0xcf/0x120 net/socket.c:724 _syssendmsg+0x6e8/0x810 net/socket.c:2409 syssendmsg+0xf3/0x170 net/socket.c:2463 _syssendmsg+0xe5/0x1b0 net/socket.c:2492 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x35/0xb0 arch/x86/entry/common.c:80 entrySYSCALL64afterhwframe+0x44/0xae