KCSAN: data-race in pcpu_alloc / pcpu_free_area (3)

13 views
Skip to first unread message

syzbot

unread,
Nov 29, 2021, 12:24:24 PM11/29/21
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d58071a8a76d Linux 5.16-rc3
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1095fff6b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=5308954916f6d362
dashboard link: https://syzkaller.appspot.com/bug?extid=041c26cb85794b7e414d
compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2
CC: [core...@netfilter.org da...@davemloft.net f...@strlen.de kad...@netfilter.org ku...@kernel.org linux-...@vger.kernel.org net...@vger.kernel.org netfilt...@vger.kernel.org pa...@netfilter.org]

Unfortunately, I don't have any reproducer for this issue yet.

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

==================================================================
BUG: KCSAN: data-race in pcpu_alloc / pcpu_free_area

write to 0xffffffff86dc55a4 of 4 bytes by task 1838 on cpu 0:
pcpu_update_empty_pages mm/percpu.c:606 [inline]
pcpu_block_update_hint_free mm/percpu.c:1041 [inline]
pcpu_free_area+0x545/0x5d0 mm/percpu.c:1298
free_percpu+0x1c5/0x9f0 mm/percpu.c:2284
xt_percpu_counter_free+0x5f/0x70 net/netfilter/x_tables.c:1950
cleanup_entry+0x17a/0x1a0 net/ipv4/netfilter/ip_tables.c:656
__do_replace+0x45e/0x580 net/ipv4/netfilter/ip_tables.c:1085
do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline]
do_ipt_set_ctl+0x1466/0x1710 net/ipv4/netfilter/ip_tables.c:1630
nf_setsockopt+0x1a6/0x1c0 net/netfilter/nf_sockopt.c:101
ip_setsockopt+0x2815/0x2c80 net/ipv4/ip_sockglue.c:1444
tcp_setsockopt+0x8c/0xa0 net/ipv4/tcp.c:3656
sock_common_setsockopt+0x5d/0x70 net/core/sock.c:3478
__sys_setsockopt+0x209/0x2a0 net/socket.c:2176
__do_sys_setsockopt net/socket.c:2187 [inline]
__se_sys_setsockopt net/socket.c:2184 [inline]
__x64_sys_setsockopt+0x62/0x70 net/socket.c:2184
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffffffff86dc55a4 of 4 bytes by task 25872 on cpu 1:
pcpu_alloc+0x9c0/0xf80 mm/percpu.c:1878
__alloc_percpu_gfp+0x22/0x30 mm/percpu.c:1937
percpu_ref_init+0x2f/0x250 lib/percpu-refcount.c:72
io_rsrc_node_alloc fs/io_uring.c:7767 [inline]
io_rsrc_node_switch_start+0x71/0x110 fs/io_uring.c:7810
io_uring_create+0x37a/0x754 fs/io_uring.c:10442
io_uring_setup fs/io_uring.c:10524 [inline]
__do_sys_io_uring_setup fs/io_uring.c:10530 [inline]
__se_sys_io_uring_setup fs/io_uring.c:10527 [inline]
__x64_sys_io_uring_setup+0x118/0x130 fs/io_uring.c:10527
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x00000007 -> 0x00000008

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 25872 Comm: syz-executor.0 Not tainted 5.16.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================


---
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.

syzbot

unread,
May 21, 2022, 1:05:25 PM5/21/22
to syzkaller-upst...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3b5e1590a267 Merge tag 'gpio-fixes-for-v5.18' of git://git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=130697adf00000
kernel config: https://syzkaller.appspot.com/x/.config?x=83a97198b5da3a53
dashboard link: https://syzkaller.appspot.com/bug?extid=041c26cb85794b7e414d
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13cd0ad6f00000
CC: [linux-...@vger.kernel.org linux-...@vger.kernel.org vi...@zeniv.linux.org.uk]

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

==================================================================
BUG: KCSAN: data-race in pcpu_alloc / pcpu_free_area

read-write to 0xffffffff86e8f9bc of 4 bytes by interrupt on cpu 0:
pcpu_update_empty_pages mm/percpu.c:606 [inline]
pcpu_block_update_hint_free mm/percpu.c:1040 [inline]
pcpu_free_area+0x52a/0x5c0 mm/percpu.c:1298
free_percpu+0x1d5/0xa50 mm/percpu.c:2281
free_vfsmnt fs/namespace.c:612 [inline]
delayed_free_vfsmnt+0xa3/0xe0 fs/namespace.c:619
rcu_do_batch kernel/rcu/tree.c:2535 [inline]
rcu_core+0x57e/0xbb0 kernel/rcu/tree.c:2786
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2803
__do_softirq+0x158/0x2e3 kernel/softirq.c:558
run_ksoftirqd+0x1f/0x30 kernel/softirq.c:921
smpboot_thread_fn+0x308/0x4a0 kernel/smpboot.c:164
kthread+0x1a9/0x1e0 kernel/kthread.c:376
ret_from_fork+0x1f/0x30

read to 0xffffffff86e8f9bc of 4 bytes by task 2063 on cpu 1:
pcpu_alloc+0x9bb/0xfb0 mm/percpu.c:1877
__alloc_percpu+0x20/0x30 mm/percpu.c:1949
alloc_vfsmnt+0xcf/0x2e0 fs/namespace.c:214
clone_mnt+0x40/0x880 fs/namespace.c:1104
copy_tree+0x313/0x870 fs/namespace.c:1921
copy_mnt_ns+0x116/0x600 fs/namespace.c:3480
create_new_namespaces+0x88/0x450 kernel/nsproxy.c:78
unshare_nsproxy_namespaces+0xe2/0x120 kernel/nsproxy.c:226
ksys_unshare+0x38c/0x6e0 kernel/fork.c:3132
__do_sys_unshare kernel/fork.c:3203 [inline]
__se_sys_unshare kernel/fork.c:3201 [inline]
__x64_sys_unshare+0x1b/0x20 kernel/fork.c:3201
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: 0x00000005 -> 0x00000006

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 2063 Comm: syz-executor.0 Not tainted 5.18.0-rc7-syzkaller-00136-g3b5e1590a267-dirty #0
Reply all
Reply to author
Forward
0 new messages