syzbot


UBSAN: undefined-behaviour in red_change

Status: upstream: reported C repro on 2020/09/25 20:30
Reported-by: syzbot+dc4229ec024e34b71a59@syzkaller.appspotmail.com
First crash: 1301d, last: 1279d
Fix bisection: failed (error log, bisect log)
  

Sample crash report:
IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready
batman_adv: batadv0: Interface activated: batadv_slave_1
IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready
================================================================================
UBSAN: Undefined behaviour in ./include/net/red.h:214:22
shift exponent 75 is too large for 32-bit type 'int'
CPU: 1 PID: 6503 Comm: syz-executor641 Not tainted 4.19.152-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x22c/0x33e lib/dump_stack.c:118
 ubsan_epilogue+0xe/0x3a lib/ubsan.c:161
 __ubsan_handle_shift_out_of_bounds.cold+0x1c4/0x250 lib/ubsan.c:422
 red_set_parms include/net/red.h:214 [inline]
 red_change.cold+0x4d/0xd3 net/sched/sch_red.c:240
 qdisc_create+0x534/0x1080 net/sched/sch_api.c:1155
 tc_modify_qdisc+0x4c0/0x195b net/sched/sch_api.c:1571
 rtnetlink_rcv_msg+0x498/0xc10 net/core/rtnetlink.c:4778
 netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2455
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x717/0xcc0 net/netlink/af_netlink.c:1909
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xc7/0x130 net/socket.c:632
 ___sys_sendmsg+0x3b3/0x8f0 net/socket.c:2115
 __sys_sendmmsg+0x195/0x470 net/socket.c:2210
 __do_sys_sendmmsg net/socket.c:2239 [inline]
 __se_sys_sendmmsg net/socket.c:2236 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2236
 do_syscall_64+0xf9/0x670 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x443709
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 db 0d fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd3113db18 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000443709
RDX: 0492492492492642 RSI: 0000000020000180 RDI: 0000000000000004
RBP: 00007ffd3113db20 R08: 0000000001bbbbbb R09: 0000000001bbbbbb
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd3113db30
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
================================================================================
================================================================================
UBSAN: Undefined behaviour in ./include/net/red.h:269:27
shift exponent 75 is too large for 64-bit type 'long int'
CPU: 0 PID: 3417 Comm: kworker/0:2 Not tainted 4.19.152-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: ipv6_addrconf addrconf_dad_work
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x22c/0x33e lib/dump_stack.c:118
 ubsan_epilogue+0xe/0x3a lib/ubsan.c:161
 __ubsan_handle_shift_out_of_bounds.cold+0x1c4/0x250 lib/ubsan.c:422
 red_calc_qavg_from_idle_time include/net/red.h:269 [inline]
 red_calc_qavg include/net/red.h:313 [inline]
 red_enqueue+0x1ced/0x2200 net/sched/sch_red.c:68
 __dev_xmit_skb net/core/dev.c:3494 [inline]
 __dev_queue_xmit+0x14e1/0x2ec0 net/core/dev.c:3807
 br_dev_queue_push_xmit+0x25a/0x6c0 net/bridge/br_forward.c:56
 br_nf_dev_queue_xmit+0x2c3/0x15d0 net/bridge/br_netfilter_hooks.c:727
 NF_HOOK include/linux/netfilter.h:289 [inline]
 br_nf_post_routing+0xa7e/0x11f0 net/bridge/br_netfilter_hooks.c:828
 nf_hook_entry_hookfn include/linux/netfilter.h:119 [inline]
 nf_hook_slow+0xc5/0x1e0 net/netfilter/core.c:511
 nf_hook include/linux/netfilter.h:244 [inline]
 NF_HOOK include/linux/netfilter.h:287 [inline]
 br_forward_finish+0x29a/0x430 net/bridge/br_forward.c:69
 br_nf_hook_thresh+0x2d7/0x370 net/bridge/br_netfilter_hooks.c:1011
 br_nf_forward_finish+0x335/0x6d0 net/bridge/br_netfilter_hooks.c:553
 NF_HOOK include/linux/netfilter.h:289 [inline]
 br_nf_forward_ip+0xad1/0x1620 net/bridge/br_netfilter_hooks.c:620
 nf_hook_entry_hookfn include/linux/netfilter.h:119 [inline]
 nf_hook_slow+0xc5/0x1e0 net/netfilter/core.c:511
 nf_hook include/linux/netfilter.h:244 [inline]
 NF_HOOK include/linux/netfilter.h:287 [inline]
 __br_forward+0x3c8/0xbb0 net/bridge/br_forward.c:113
 deliver_clone net/bridge/br_forward.c:129 [inline]
 br_flood+0x3ee/0x4f0 net/bridge/br_forward.c:238
 br_handle_frame_finish+0xfcc/0x14d0 net/bridge/br_input.c:167
 br_nf_hook_thresh+0x2d7/0x370 net/bridge/br_netfilter_hooks.c:1011
 br_nf_pre_routing_finish_ipv6+0x701/0xd90 net/bridge/br_netfilter_ipv6.c:210
 NF_HOOK include/linux/netfilter.h:289 [inline]
 br_nf_pre_routing_ipv6+0x3f4/0x8ca net/bridge/br_netfilter_ipv6.c:240
 br_nf_pre_routing+0x9c7/0x152c net/bridge/br_netfilter_hooks.c:494
 nf_hook_entry_hookfn include/linux/netfilter.h:119 [inline]
 nf_hook_slow+0xc5/0x1e0 net/netfilter/core.c:511
 nf_hook include/linux/netfilter.h:244 [inline]
 NF_HOOK include/linux/netfilter.h:287 [inline]
 br_handle_frame+0xb24/0x151a net/bridge/br_input.c:306
 __netif_receive_skb_core+0x7d5/0x33c0 net/core/dev.c:4876
 __netif_receive_skb_one_core+0xae/0x180 net/core/dev.c:4952
 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5066
 process_backlog+0x261/0x760 net/core/dev.c:5848
 napi_poll net/core/dev.c:6272 [inline]
 net_rx_action+0x4e5/0x10d0 net/core/dev.c:6338
 __do_softirq+0x27d/0xad2 kernel/softirq.c:292
 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1092
 </IRQ>
 do_softirq.part.0+0x168/0x200 kernel/softirq.c:336
 do_softirq kernel/softirq.c:328 [inline]
 __local_bh_enable_ip+0x22d/0x2a0 kernel/softirq.c:189
 local_bh_enable include/linux/bottom_half.h:32 [inline]
 rcu_read_unlock_bh include/linux/rcupdate.h:721 [inline]
 ip6_finish_output2+0x120d/0x2370 net/ipv6/ip6_output.c:121
 ip6_finish_output+0x610/0xcc0 net/ipv6/ip6_output.c:154
 NF_HOOK_COND include/linux/netfilter.h:278 [inline]
 ip6_output+0x205/0x7c0 net/ipv6/ip6_output.c:171
 dst_output include/net/dst.h:455 [inline]
 NF_HOOK include/linux/netfilter.h:289 [inline]
 ndisc_send_skb+0xa6b/0x1860 net/ipv6/ndisc.c:491
 ndisc_send_ns+0x51d/0x840 net/ipv6/ndisc.c:633
 addrconf_dad_work+0xb78/0x1130 net/ipv6/addrconf.c:4075
 process_one_work+0x796/0x14e0 kernel/workqueue.c:2155
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2298
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
================================================================================
================================================================================
UBSAN: Undefined behaviour in ./include/net/red.h:272:18
shift exponent 163 is too large for 64-bit type 'long unsigned int'
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.19.152-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x22c/0x33e lib/dump_stack.c:118
 ubsan_epilogue+0xe/0x3a lib/ubsan.c:161
 __ubsan_handle_shift_out_of_bounds.cold+0x1c4/0x250 lib/ubsan.c:422
 red_calc_qavg_from_idle_time include/net/red.h:272 [inline]
 red_adaptative_algo include/net/red.h:404 [inline]
 red_adaptative_timer+0x7ed/0x870 net/sched/sch_red.c:266
 call_timer_fn+0x177/0x760 kernel/time/timer.c:1338
 expire_timers+0x243/0x500 kernel/time/timer.c:1375
 __run_timers kernel/time/timer.c:1703 [inline]
 run_timer_softirq+0x259/0x730 kernel/time/timer.c:1716
 __do_softirq+0x27d/0xad2 kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:372 [inline]
 irq_exit+0x22d/0x270 kernel/softirq.c:412
 exiting_irq arch/x86/include/asm/apic.h:544 [inline]
 smp_apic_timer_interrupt+0x15f/0x5d0 arch/x86/kernel/apic/apic.c:1094
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
 </IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
Code: e9 73 fd ff ff 48 89 df e8 2f 06 fa f9 e9 59 ff ff ff 90 90 90 90 90 90 90 90 90 90 e9 07 00 00 00 0f 00 2d 74 3b 57 00 fb f4 <c3> 90 e9 07 00 00 00 0f 00 2d 64 3b 57 00 f4 c3 90 90 41 56 41 55
RSP: 0018:ffff8880a9a6fd58 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff12c7140 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff8880a9a60c44
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff896389f0
R13: 1ffff1101534dfb5 R14: 0000000000000000 R15: 0000000000000000
 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline]
 default_idle+0x49/0x320 arch/x86/kernel/process.c:557
 cpuidle_idle_call kernel/sched/idle.c:153 [inline]
 do_idle+0x2f8/0x500 kernel/sched/idle.c:263
 cpu_startup_entry+0xc5/0xd6 kernel/sched/idle.c:369
 start_secondary+0x44d/0x610 arch/x86/kernel/smpboot.c:271
 secondary_startup

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/10/17 21:10 linux-4.19.y ad326970d25c fea47c01 .config console log report syz C ci2-linux-4-19
2020/09/25 23:48 linux-4.19.y d09b80172c22 4a006f63 .config console log report syz C ci2-linux-4-19
2020/10/16 10:18 linux-4.19.y a1b977b49b66 6e262c73 .config console log report info ci2-linux-4-19
2020/10/03 06:19 linux-4.19.y b09c34517e1a 2653fa43 .config console log report info ci2-linux-4-19
2020/09/25 20:29 linux-4.19.y d09b80172c22 4a006f63 .config console log report info ci2-linux-4-19
* Struck through repros no longer work on HEAD.