syzbot


KCSAN: data-race in pcpu_alloc / pcpu_alloc

Status: auto-closed as invalid on 2022/05/20 04:11
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 235d, last: 235d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in pcpu_alloc / pcpu_alloc (3) 1 37d 37d 0/24 auto-obsoleted due to no activity on 2022/12/03 18:53
upstream KCSAN: data-race in pcpu_alloc / pcpu_alloc (2) 3 119d 141d 0/24 auto-closed as invalid on 2022/09/13 08:17

Sample crash report:
==================================================================
BUG: KCSAN: data-race in pcpu_alloc / pcpu_alloc

read-write to 0xffffffff86e8f9bc of 4 bytes by task 1820 on cpu 1:
 pcpu_update_empty_pages mm/percpu.c:606 [inline]
 pcpu_chunk_populated mm/percpu.c:1534 [inline]
 pcpu_alloc+0x8e8/0xfb0 mm/percpu.c:1870
 __alloc_percpu+0x20/0x30 mm/percpu.c:1949
 xt_percpu_counter_alloc+0x6e/0x110 net/netfilter/x_tables.c:1930
 find_check_entry net/ipv4/netfilter/ip_tables.c:528 [inline]
 translate_table+0x96c/0xfb0 net/ipv4/netfilter/ip_tables.c:718
 ipt_register_table+0x95/0x3d0 net/ipv4/netfilter/ip_tables.c:1737
 iptable_raw_table_init+0x73/0xa0 net/ipv4/netfilter/iptable_raw.c:49
 xt_find_table_lock+0x1c9/0x2d0 net/netfilter/x_tables.c:1259
 xt_request_find_table_lock+0x22/0xa0 net/netfilter/x_tables.c:1284
 get_info net/ipv4/netfilter/ip_tables.c:965 [inline]
 do_ipt_get_ctl+0x53b/0xbd0 net/ipv4/netfilter/ip_tables.c:1654
 nf_getsockopt+0x18f/0x1b0 net/netfilter/nf_sockopt.c:116
 ip_getsockopt+0xc33/0xe20 net/ipv4/ip_sockglue.c:1786
 tcp_getsockopt+0xe8/0x18d0 net/ipv4/tcp.c:4295
 sock_common_getsockopt+0x53/0x60 net/core/sock.c:3478
 __sys_getsockopt+0x17a/0x1e0 net/socket.c:2224
 __do_sys_getsockopt net/socket.c:2239 [inline]
 __se_sys_getsockopt net/socket.c:2236 [inline]
 __x64_sys_getsockopt+0x62/0x70 net/socket.c:2236
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffffffff86e8f9bc of 4 bytes by task 1822 on cpu 0:
 pcpu_alloc+0x9bb/0xfb0 mm/percpu.c:1877
 __alloc_percpu_gfp+0x22/0x30 mm/percpu.c:1936
 fib_nh_common_init+0x45/0x1a0 net/ipv4/fib_semantics.c:588
 fib6_nh_init+0xd9b/0x1370 net/ipv6/route.c:3607
 ip6_route_info_create+0x7ca/0xbb0 net/ipv6/route.c:3798
 ip6_route_add+0x22/0x100 net/ipv6/route.c:3842
 addrconf_prefix_route net/ipv6/addrconf.c:2418 [inline]
 fixup_permanent_addr net/ipv6/addrconf.c:3469 [inline]
 addrconf_permanent_addr+0x463/0x5d0 net/ipv6/addrconf.c:3493
 addrconf_notify+0x57d/0x950 net/ipv6/addrconf.c:3561
 notifier_call_chain kernel/notifier.c:84 [inline]
 raw_notifier_call_chain+0x53/0xb0 kernel/notifier.c:392
 __dev_notify_flags+0x1d6/0x3a0
 dev_change_flags+0xa2/0xc0 net/core/dev.c:8509
 do_setlink+0x7f9/0x2120 net/core/rtnetlink.c:2731
 __rtnl_newlink net/core/rtnetlink.c:3416 [inline]
 rtnl_newlink+0x1116/0x1580 net/core/rtnetlink.c:3531
 rtnetlink_rcv_msg+0x74f/0x7e0 net/core/rtnetlink.c:5990
 netlink_rcv_skb+0x13e/0x240 net/netlink/af_netlink.c:2496
 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:6008
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x58a/0x660 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x661/0x750 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:705 [inline]
 sock_sendmsg net/socket.c:725 [inline]
 __sys_sendto+0x21e/0x2c0 net/socket.c:2040
 __do_sys_sendto net/socket.c:2052 [inline]
 __se_sys_sendto net/socket.c:2048 [inline]
 __x64_sys_sendto+0x74/0x90 net/socket.c:2048
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0xffffffff -> 0x00000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 1822 Comm: syz-executor.3 Not tainted 5.18.0-rc2-syzkaller-00122-gb9b4c79e5830-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================
device veth0_vlan entered promiscuous mode
device veth1_vlan entered promiscuous mode
device veth0_macvtap entered promiscuous mode
device veth1_macvtap entered promiscuous mode
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: batadv0: Interface activated: batadv_slave_0
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1
batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!
batman_adv: batadv0: Interface activated: batadv_slave_1
netdevsim netdevsim3 netdevsim0: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim3 netdevsim1: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim3 netdevsim2: set [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim3 netdevsim3: set [1, 0] type 2 family 0 port 6081 - 0

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/04/15 04:03 upstream b9b4c79e5830 b17b2923 .config log report info KCSAN: data-race in pcpu_alloc / pcpu_alloc
* Struck through repros no longer work on HEAD.