[syzbot] [net?] WARNING: ODEBUG bug in advance_sched

12 views
Skip to first unread message

syzbot

unread,
Dec 21, 2023, 8:47:26 AM12/21/23
to da...@davemloft.net, edum...@google.com, j...@mojatatu.com, ji...@resnulli.us, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com, viniciu...@intel.com, xiyou.w...@gmail.com
Hello,

syzbot found the following issue on:

HEAD commit: 1a44b0073b92 Merge tag 'ovl-fixes-6.7-rc7' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13ecdd9ee80000
kernel config: https://syzkaller.appspot.com/x/.config?x=314e9ad033a7d3a7
dashboard link: https://syzkaller.appspot.com/bug?extid=ec9b5cce58002d184fb6
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=12d5bc6ee80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1465cbd6e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/56ceeac02b60/disk-1a44b007.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/74fea7b7a52f/vmlinux-1a44b007.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3757dfd10a24/bzImage-1a44b007.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ec9b5c...@syzkaller.appspotmail.com

------------[ cut here ]------------
ODEBUG: activate active (active state 1) object: ffff88801f9b1d00 object type: rcu_head hint: 0x0
WARNING: CPU: 1 PID: 6703 at lib/debugobjects.c:514 debug_print_object+0x1a0/0x2a0 lib/debugobjects.c:514
Modules linked in:
CPU: 1 PID: 6703 Comm: syz-executor263 Not tainted 6.7.0-rc6-syzkaller-00044-g1a44b0073b92 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:debug_print_object+0x1a0/0x2a0 lib/debugobjects.c:514
Code: fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 75 4c 48 8b 14 dd a0 0c 2f 8b 41 56 4c 89 e6 48 c7 c7 00 00 2f 8b e8 b1 66 e5 fc 90 <0f> 0b 90 90 58 83 05 38 1c b1 0a 01 48 83 c4 18 5b 5d 41 5c 41 5d
RSP: 0018:ffffc900001f0bd8 EFLAGS: 00010086
RAX: 0000000000000000 RBX: 0000000000000003 RCX: ffffffff814db519
RDX: ffff888022be3b80 RSI: ffffffff814db526 RDI: 0000000000000001
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffffffff8b2f06a0
R13: ffffffff8ace3260 R14: 0000000000000000 R15: ffff88801cc40ad0
FS: 0000555556866380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fe6293cf2d0 CR3: 0000000028c3c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
debug_object_activate+0x327/0x490 lib/debugobjects.c:733
debug_rcu_head_queue kernel/rcu/rcu.h:227 [inline]
__call_rcu_common.constprop.0+0x2c/0x7a0 kernel/rcu/tree.c:2666
switch_schedules net/sched/sch_taprio.c:210 [inline]
advance_sched+0x59e/0xc60 net/sched/sch_taprio.c:984
__run_hrtimer kernel/time/hrtimer.c:1688 [inline]
__hrtimer_run_queues+0x203/0xc20 kernel/time/hrtimer.c:1752
hrtimer_interrupt+0x31b/0x800 kernel/time/hrtimer.c:1814
local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1065 [inline]
__sysvec_apic_timer_interrupt+0x105/0x400 arch/x86/kernel/apic/apic.c:1082
sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1076
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649
RIP: 0010:__sanitizer_cov_trace_switch+0x3b/0x90 kernel/kcov.c:341
Code: 53 48 8b 46 08 48 83 f8 20 74 63 77 44 48 83 f8 08 74 53 48 83 f8 10 75 2f 41 bd 03 00 00 00 4c 8b 75 00 31 db 4d 85 f6 74 1e <48> 8b 74 dd 10 4c 89 e2 4c 89 ef 48 83 c3 01 48 8b 4c 24 28 e8 2c
RSP: 0018:ffffc9000b956da0 EFLAGS: 00000202
RAX: 0000000000000000 RBX: 0000000000000006 RCX: ffffffff8139fcf5
RDX: ffff888022be3b80 RSI: 0000000000000007 RDI: 0000000000000001
RBP: ffffffff8ac9d140 R08: 0000000000000001 R09: 0000000000000007
R10: 0000000000000004 R11: 0000000000000001 R12: 0000000000000004
R13: 0000000000000001 R14: 0000000000000008 R15: ffffc9000b956e85
unwind_next_frame+0x6b5/0x2390 arch/x86/kernel/unwind_orc.c:515
arch_stack_walk+0xfa/0x170 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x96/0xd0 kernel/stacktrace.c:122
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
kmem_cache_free+0xf8/0x350 mm/slub.c:3831
kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:1015
__kfree_skb net/core/skbuff.c:1073 [inline]
consume_skb net/core/skbuff.c:1288 [inline]
consume_skb+0xdf/0x170 net/core/skbuff.c:1282
netlink_broadcast_filtered+0x3e3/0xf20 net/netlink/af_netlink.c:1554
netlink_broadcast net/netlink/af_netlink.c:1576 [inline]
nlmsg_multicast include/net/netlink.h:1090 [inline]
nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2588
qdisc_notify.isra.0+0x1cd/0x330 net/sched/sch_api.c:1030
tc_modify_qdisc+0x914/0x1c40 net/sched/sch_api.c:1719
rtnetlink_rcv_msg+0x3c7/0xe00 net/core/rtnetlink.c:6558
netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545
netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1368
netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910
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:0x7fe62934e759
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 19 00 00 90 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:00007ffc987f8528 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000007 RCX: 00007fe62934e759
RDX: 0000000004008000 RSI: 00000000200000c0 RDI: 0000000000000004
RBP: 00000000000f4240 R08: 0000000100000000 R09: 0000000100000000
R10: 0000000100000000 R11: 0000000000000246 R12: 00007ffc987f8580
R13: 00000000000454f4 R14: 00007ffc987f854c R15: 0000000000000003
</TASK>
----------------
Code disassembly (best guess):
0: 53 push %rbx
1: 48 8b 46 08 mov 0x8(%rsi),%rax
5: 48 83 f8 20 cmp $0x20,%rax
9: 74 63 je 0x6e
b: 77 44 ja 0x51
d: 48 83 f8 08 cmp $0x8,%rax
11: 74 53 je 0x66
13: 48 83 f8 10 cmp $0x10,%rax
17: 75 2f jne 0x48
19: 41 bd 03 00 00 00 mov $0x3,%r13d
1f: 4c 8b 75 00 mov 0x0(%rbp),%r14
23: 31 db xor %ebx,%ebx
25: 4d 85 f6 test %r14,%r14
28: 74 1e je 0x48
* 2a: 48 8b 74 dd 10 mov 0x10(%rbp,%rbx,8),%rsi <-- trapping instruction
2f: 4c 89 e2 mov %r12,%rdx
32: 4c 89 ef mov %r13,%rdi
35: 48 83 c3 01 add $0x1,%rbx
39: 48 8b 4c 24 28 mov 0x28(%rsp),%rcx
3e: e8 .byte 0xe8
3f: 2c .byte 0x2c


---
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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

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

syzbot

unread,
Dec 21, 2023, 2:33:08 PM12/21/23
to da...@davemloft.net, edum...@google.com, j...@mojatatu.com, ji...@resnulli.us, ku...@kernel.org, leandro.mac...@intel.com, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, syzkall...@googlegroups.com, vedang...@intel.com, viniciu...@intel.com, xiyou.w...@gmail.com
syzbot has bisected this issue to:

commit 7b9eba7ba0c1b24df42b70b62d154b284befbccf
Author: Leandro Dorileo <leandro.mac...@intel.com>
Date: Mon Apr 8 17:12:17 2019 +0000

net/sched: taprio: fix picos_per_byte miscalculation

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=116aaa79e80000
start commit: 1a44b0073b92 Merge tag 'ovl-fixes-6.7-rc7' of git://git.ke..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=136aaa79e80000
console output: https://syzkaller.appspot.com/x/log.txt?x=156aaa79e80000
Reported-by: syzbot+ec9b5c...@syzkaller.appspotmail.com
Fixes: 7b9eba7ba0c1 ("net/sched: taprio: fix picos_per_byte miscalculation")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Hillf Danton

unread,
Dec 22, 2023, 6:07:30 AM12/22/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On Thu, 21 Dec 2023 05:47:25 -0800
> HEAD commit: 1a44b0073b92 Merge tag 'ovl-fixes-6.7-rc7' of git://git.ke..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1465cbd6e80000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

--- x/net/sched/sch_taprio.c
+++ y/net/sched/sch_taprio.c
@@ -1941,6 +1941,9 @@ static int taprio_change(struct Qdisc *s

/* Protects against enqueue()/dequeue() */
spin_lock_bh(qdisc_lock(sch));
+ spin_lock_irqsave(&q->current_entry_lock, flags);
+ oper = rtnl_dereference(q->oper_sched);
+ admin = rtnl_dereference(q->admin_sched);

if (tb[TCA_TAPRIO_ATTR_TXTIME_DELAY]) {
if (!TXTIME_ASSIST_IS_ENABLED(q->flags)) {
@@ -1981,17 +1984,12 @@ static int taprio_change(struct Qdisc *s
} else {
setup_first_end_time(q, new_admin, start);

- /* Protects against advance_sched() */
- spin_lock_irqsave(&q->current_entry_lock, flags);
-
taprio_start_sched(sch, start, new_admin);

rcu_assign_pointer(q->admin_sched, new_admin);
if (admin)
call_rcu(&admin->rcu, taprio_free_sched_cb);

- spin_unlock_irqrestore(&q->current_entry_lock, flags);
-
if (FULL_OFFLOAD_IS_ENABLED(q->flags))
taprio_offload_config_changed(q);
}
@@ -2004,6 +2002,7 @@ static int taprio_change(struct Qdisc *s
"Size table not specified, frame length estimations may be inaccurate");

unlock:
+ spin_unlock_irqrestore(&q->current_entry_lock, flags);
spin_unlock_bh(qdisc_lock(sch));

free_sched:
@@ -2393,7 +2392,9 @@ static int taprio_dump(struct Qdisc *sch
struct sched_gate_list *oper, *admin;
struct tc_mqprio_qopt opt = { 0 };
struct nlattr *nest, *sched_nest;
+ unsigned long flags;

+ spin_lock_irqsave(&q->current_entry_lock, flags);
oper = rtnl_dereference(q->oper_sched);
admin = rtnl_dereference(q->admin_sched);

@@ -2436,6 +2437,7 @@ static int taprio_dump(struct Qdisc *sch
nla_nest_end(skb, sched_nest);

done:
+ spin_unlock_irqrestore(&q->current_entry_lock, flags);
return nla_nest_end(skb, nest);

admin_error:
@@ -2445,6 +2447,7 @@ options_error:
nla_nest_cancel(skb, nest);

start_error:
+ spin_unlock_irqrestore(&q->current_entry_lock, flags);
return -ENOSPC;
}

--

syzbot

unread,
Dec 22, 2023, 6:37:05 AM12/22/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

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

Reported-and-tested-by: syzbot+ec9b5c...@syzkaller.appspotmail.com

Tested on:

commit: 24e0d2e5 Merge tag 'pinctrl-v6.7-4' of git://git.kerne..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=11c4039ee80000
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=177321c9e80000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages