Skip to contentSkip to conversation

general protection fault in qdisc_create

syzbot syzbot 2 participants 4 messages Dec 31, 2023 – Jan 4, 2024

Subsystems (3)
lore
Share & tools
lore

syzbot

author syzbot
#0 lore raw

Hello,

syzbot found the following issue on:

HEAD commit:    c2b2ee36250d bridge: cfm: fix enum typo in br_cc_ccm_tx_pa..
git tree:       net-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=15812036e80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a4e9ca8e3c104d2a
dashboard link: https://syzkaller.appspot.com/bug?extid=84339b9e7330daae4d66
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13535445e80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15fed8f6e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7344dc892eab/disk-c2b2ee36.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b5d04995c162/vmlinux-c2b2ee36.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9558856ab7f4/bzImage-c2b2ee36.xz

The issue was bisected to:

commit 913b47d3424e7d99eaf34b798c47dfa840c64a08

Author: Victor Nogueira <[email protected]>
Date:   Tue Dec 19 18:16:19 2023 +0000

net/sched: Introduce tc block netdev tracking infra

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=11992409e80000
final oops:     https://syzkaller.appspot.com/x/report.txt?x=13992409e80000
console output: https://syzkaller.appspot.com/x/log.txt?x=15992409e80000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]
Fixes 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra")
general protection fault, probably for non-canonical address 0xdffffc0000000009: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000048-0x000000000000004f]
CPU: 1 PID: 5061 Comm: syz-executor323 Not tainted 6.7.0-rc6-syzkaller-01658-gc2b2ee36250d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:qdisc_block_add_dev net/sched/sch_api.c:1190 [inline]
RIP: 0010:qdisc_create+0x69e/0x1430 net/sched/sch_api.c:1390
Code: ea 03 80 3c 02 00 0f 85 50 0c 00 00 4c 8b 6d 08 49 8d 45 48 48 89 c2 48 89 44 24 18 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 0f 0c 00 00 31 d2 be f2 ff 00 00 48 89 df 41 ff
RSP: 0018:ffffc9000398f420 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff88802688c800 RCX: ffffffff888dbd56
RDX: 0000000000000009 RSI: ffffffff888db6fe RDI: ffffffff8f19bde8
RBP: ffffffff8f19bde0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffff88804fd64000
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8f19bde0
FS:  0000555556ef3380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001248 CR3: 0000000027f71000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 tc_modify_qdisc+0x4d5/0x1c30 net/sched/sch_api.c:1788
 rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6615
 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2543
 netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
 netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1367
 netlink_sendmsg+0x8b7/0xd70 net/netlink/af_netlink.c:1908
 sock_sendmsg_nosec net/socket.c:730 [inline]
 __sock_sendmsg+0xd5/0x180 net/socket.c:745
 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2584
 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2638
 __sys_sendmsg+0x117/0x1e0 net/socket.c:2667
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f9733a8a8b9
Code: 48 83 c4 28 c3 e8 27 18 00 00 0f 1f 80 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd50d7c048 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9733a8a8b9
RDX: 0000000000000000 RSI: 0000000020005840 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 00007ffd50d7c0c0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd50d7c248 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:qdisc_block_add_dev net/sched/sch_api.c:1190 [inline]
RIP: 0010:qdisc_create+0x69e/0x1430 net/sched/sch_api.c:1390
Code: ea 03 80 3c 02 00 0f 85 50 0c 00 00 4c 8b 6d 08 49 8d 45 48 48 89 c2 48 89 44 24 18 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 0f 0c 00 00 31 d2 be f2 ff 00 00 48 89 df 41 ff
RSP: 0018:ffffc9000398f420 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff88802688c800 RCX: ffffffff888dbd56
RDX: 0000000000000009 RSI: ffffffff888db6fe RDI: ffffffff8f19bde8
RBP: ffffffff8f19bde0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffff88804fd64000
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8f19bde0
FS:  0000555556ef3380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001248 CR3: 0000000027f71000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	03 80 3c 02 00 0f    	add    0xf00023c(%rax),%eax
   6:	85 50 0c             	test   %edx,0xc(%rax)
   9:	00 00                	add    %al,(%rax)
   b:	4c 8b 6d 08          	mov    0x8(%rbp),%r13
   f:	49 8d 45 48          	lea    0x48(%r13),%rax
  13:	48 89 c2             	mov    %rax,%rdx
  16:	48 89 44 24 18       	mov    %rax,0x18(%rsp)
  1b:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  22:	fc ff df
  25:	48 c1 ea 03          	shr    $0x3,%rdx
* 29:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2d:	0f 85 0f 0c 00 00    	jne    0xc42
  33:	31 d2                	xor    %edx,%edx
  35:	be f2 ff 00 00       	mov    $0xfff2,%esi
  3a:	48 89 df             	mov    %rbx,%rdi
  3d:	41                   	rex.B
  3e:	ff                   	.byte 0xff

---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot. For information about bisection process see: https://goo.gl/tpsmEJ#bisection

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

Reviewed-by Jamal Hadi Salim
#1 lore raw
Quoted 3 lines · syzbot
HEAD commit:    c2b2ee36250d bridge: cfm: fix enum typo in br_cc_ccm_tx_pa..
git tree:       net-next
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15fed8f6e80000

#syz test

From e63340707ce85f8608e3c3ae3cec1340ef17eede Mon Sep 17 00:00:00 2001
From: Victor Nogueira <[email protected]>
Date: Thu, 28 Dec 2023 13:18:49 +0000
Subject: [PATCH net-next 1/1] net/sched: We should only add appropriate qdiscs
blocks to ports' xarray

We should only add qdiscs to the blocks ports' xarray in ingress that support ingress_block_set/get or in egress that support egress_block_set/get.

Fixes 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra")
---
 net/sched/sch_api.c | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)
net/sched/sch_api.c +20 -14
index 299086bb6205..426be81276f1 100644
@@ -1187,23 +1187,29 @@ static int qdisc_block_add_dev(struct Qdisc *sch, struct net_device *dev,
 	struct tcf_block *block;
 	int err;
 
-	block = cl_ops->tcf_block(sch, TC_H_MIN_INGRESS, NULL);
-	if (block) {
-		err = xa_insert(&block->ports, dev->ifindex, dev, GFP_KERNEL);
-		if (err) {
-			NL_SET_ERR_MSG(extack,
-				       "ingress block dev insert failed");
-			return err;
+	if (sch->ops->ingress_block_get) {
+		block = cl_ops->tcf_block(sch, TC_H_MIN_INGRESS, NULL);
+		if (block) {
+			err = xa_insert(&block->ports, dev->ifindex, dev,
+					GFP_KERNEL);
+			if (err) {
+				NL_SET_ERR_MSG(extack,
+					       "ingress block dev insert failed");
+				return err;
+			}
 		}
 	}
 
-	block = cl_ops->tcf_block(sch, TC_H_MIN_EGRESS, NULL);
-	if (block) {
-		err = xa_insert(&block->ports, dev->ifindex, dev, GFP_KERNEL);
-		if (err) {
-			NL_SET_ERR_MSG(extack,
-				       "Egress block dev insert failed");
-			goto err_out;
+	if (sch->ops->egress_block_get) {
+		block = cl_ops->tcf_block(sch, TC_H_MIN_EGRESS, NULL);
+		if (block) {
+			err = xa_insert(&block->ports, dev->ifindex, dev,
+					GFP_KERNEL);
+			if (err) {
+				NL_SET_ERR_MSG(extack,
+					       "Egress block dev insert failed");
+				goto err_out;
+			}
 		}
 	}
 
Signature · 1 line
2.25.1
author syzbot
#2 lore raw
syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by [email protected]

Tested on:

commit:         92de776d Merge tag 'mlx5-updates-2023-12-20' of git://..
git tree:       net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=16a43d1ae80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a4e9ca8e3c104d2a
dashboard link: https://syzkaller.appspot.com/bug?extid=84339b9e7330daae4d66
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=1662b9a1e80000

Note: testing is done by a robot and is best-effort only.

author syzbot
#3 lore raw
In reply to syzbot
For archival purposes, forwarding an incoming command email to [email protected], [email protected].

For archival purposes, forwarding an incoming command email to [email protected], [email protected].

***

Subject: Re: [syzbot] [net?] general protection fault in qdisc_create
Author: [email protected]

Quoted 123 lines · Sun, Dec 31, 2023 at 12:04:25PM CET, [email protected]…

Hello,

syzbot found the following issue on:

HEAD commit:    c2b2ee36250d bridge: cfm: fix enum typo in br_cc_ccm_tx_pa..
git tree:       net-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=15812036e80000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a4e9ca8e3c104d2a
dashboard link: https://syzkaller.appspot.com/bug?extid=84339b9e7330daae4d66
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13535445e80000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15fed8f6e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7344dc892eab/disk-c2b2ee36.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b5d04995c162/vmlinux-c2b2ee36.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9558856ab7f4/bzImage-c2b2ee36.xz

The issue was bisected to:

commit 913b47d3424e7d99eaf34b798c47dfa840c64a08

Author: Victor Nogueira <[email protected]>
Date:   Tue Dec 19 18:16:19 2023 +0000

net/sched: Introduce tc block netdev tracking infra

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=11992409e80000
final oops:     https://syzkaller.appspot.com/x/report.txt?x=13992409e80000
console output: https://syzkaller.appspot.com/x/log.txt?x=15992409e80000

IMPORTANT: if you fix the issue, please add the following tag to the commit:

Reported-by [email protected]
Fixes 913b47d3424e ("net/sched: Introduce tc block netdev tracking infra")
general protection fault, probably for non-canonical address 0xdffffc0000000009: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000048-0x000000000000004f]
CPU: 1 PID: 5061 Comm: syz-executor323 Not tainted 6.7.0-rc6-syzkaller-01658-gc2b2ee36250d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:qdisc_block_add_dev net/sched/sch_api.c:1190 [inline]
RIP: 0010:qdisc_create+0x69e/0x1430 net/sched/sch_api.c:1390
Code: ea 03 80 3c 02 00 0f 85 50 0c 00 00 4c 8b 6d 08 49 8d 45 48 48 89 c2 48 89 44 24 18 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 0f 0c 00 00 31 d2 be f2 ff 00 00 48 89 df 41 ff
RSP: 0018:ffffc9000398f420 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff88802688c800 RCX: ffffffff888dbd56
RDX: 0000000000000009 RSI: ffffffff888db6fe RDI: ffffffff8f19bde8
RBP: ffffffff8f19bde0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffff88804fd64000
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8f19bde0
FS:  0000555556ef3380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001248 CR3: 0000000027f71000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
tc_modify_qdisc+0x4d5/0x1c30 net/sched/sch_api.c:1788
rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6615
netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2543
netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline]
netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1367
netlink_sendmsg+0x8b7/0xd70 net/netlink/af_netlink.c:1908
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg+0xd5/0x180 net/socket.c:745
____sys_sendmsg+0x6ac/0x940 net/socket.c:2584
___sys_sendmsg+0x135/0x1d0 net/socket.c:2638
__sys_sendmsg+0x117/0x1e0 net/socket.c:2667
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f9733a8a8b9
Code: 48 83 c4 28 c3 e8 27 18 00 00 0f 1f 80 00 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd50d7c048 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9733a8a8b9
RDX: 0000000000000000 RSI: 0000000020005840 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 00007ffd50d7c0c0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd50d7c248 R14: 0000000000000001 R15: 0000000000000001
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:qdisc_block_add_dev net/sched/sch_api.c:1190 [inline]
RIP: 0010:qdisc_create+0x69e/0x1430 net/sched/sch_api.c:1390
Code: ea 03 80 3c 02 00 0f 85 50 0c 00 00 4c 8b 6d 08 49 8d 45 48 48 89 c2 48 89 44 24 18 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 0f 0c 00 00 31 d2 be f2 ff 00 00 48 89 df 41 ff
RSP: 0018:ffffc9000398f420 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: ffff88802688c800 RCX: ffffffff888dbd56
RDX: 0000000000000009 RSI: ffffffff888db6fe RDI: ffffffff8f19bde8
RBP: ffffffff8f19bde0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffff88804fd64000
R13: 0000000000000000 R14: 0000000000000001 R15: ffffffff8f19bde0
FS:  0000555556ef3380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001248 CR3: 0000000027f71000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
  0:	03 80 3c 02 00 0f    	add    0xf00023c(%rax),%eax
  6:	85 50 0c             	test   %edx,0xc(%rax)
  9:	00 00                	add    %al,(%rax)
  b:	4c 8b 6d 08          	mov    0x8(%rbp),%r13
  f:	49 8d 45 48          	lea    0x48(%r13),%rax
 13:	48 89 c2             	mov    %rax,%rdx
 16:	48 89 44 24 18       	mov    %rax,0x18(%rsp)
 1b:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
 22:	fc ff df
 25:	48 c1 ea 03          	shr    $0x3,%rdx
* 29:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
 2d:	0f 85 0f 0c 00 00    	jne    0xc42
 33:	31 d2                	xor    %edx,%edx
 35:	be f2 ff 00 00       	mov    $0xfff2,%esi
 3a:	48 89 df             	mov    %rbx,%rdi
 3d:	41                   	rex.B
 3e:	ff                   	.byte 0xff

---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot. For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Quoted 5 lines

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash

#syz test: https://github.com/jpirko/linux_mlxsw.git wip_tc_block_fix