[moderation] [cgroups?] [mm?] KCSAN: data-race in drain_all_stock / drain_stock (9)

2 views
Skip to first unread message

syzbot

unread,
Jan 18, 2024, 6:03:20 PMJan 18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 296455ade1fd Merge tag 'char-misc-6.8-rc1' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1357b3afe80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1a15191e1424b0dc
dashboard link: https://syzkaller.appspot.com/bug?extid=3e1db7e06629b0fa6fe5
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [ak...@linux-foundation.org cgr...@vger.kernel.org han...@cmpxchg.org linux-...@vger.kernel.org linu...@kvack.org mho...@kernel.org muchu...@linux.dev roman.g...@linux.dev shak...@google.com]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/691ac77cade8/disk-296455ad.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e2cd631ad41b/vmlinux-296455ad.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e731931a6edb/bzImage-296455ad.xz

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

==================================================================
BUG: KCSAN: data-race in drain_all_stock / drain_stock

write to 0xffff888237c2a990 of 4 bytes by task 11394 on cpu 0:
drain_stock+0x48/0xf0 mm/memcontrol.c:2340
__refill_stock+0x33/0xb0 mm/memcontrol.c:2380
refill_stock mm/memcontrol.c:2395 [inline]
try_charge_memcg+0x9eb/0xd20 mm/memcontrol.c:2846
obj_cgroup_charge_pages+0xbd/0x1c0 mm/memcontrol.c:3275
obj_cgroup_charge+0xec/0x140 mm/memcontrol.c:3566
__memcg_slab_pre_alloc_hook+0xe3/0x120 mm/slub.c:1929
memcg_slab_pre_alloc_hook mm/slub.c:1950 [inline]
slab_pre_alloc_hook mm/slub.c:3766 [inline]
slab_alloc_node mm/slub.c:3842 [inline]
kmem_cache_alloc_lru+0x19c/0x2e0 mm/slub.c:3879
alloc_inode_sb include/linux/fs.h:3019 [inline]
sock_alloc_inode+0x34/0xa0 net/socket.c:308
alloc_inode+0x38/0x150 fs/inode.c:260
new_inode_pseudo+0x17/0x70 fs/inode.c:1005
sock_alloc net/socket.c:634 [inline]
__sock_create+0x12b/0x4e0 net/socket.c:1535
sock_create net/socket.c:1622 [inline]
__sys_socket_create net/socket.c:1659 [inline]
__sys_socket+0xad/0x230 net/socket.c:1706
__do_sys_socket net/socket.c:1720 [inline]
__se_sys_socket net/socket.c:1718 [inline]
__x64_sys_socket+0x3f/0x50 net/socket.c:1718
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x59/0x120 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff888237c2a990 of 4 bytes by task 11139 on cpu 1:
drain_all_stock+0xd3/0x2e0 mm/memcontrol.c:2425
try_charge_memcg+0x6c2/0xd20 mm/memcontrol.c:2770
try_charge mm/memcontrol.c:2904 [inline]
charge_memcg mm/memcontrol.c:7241 [inline]
__mem_cgroup_charge+0x63/0xf0 mm/memcontrol.c:7256
mem_cgroup_charge include/linux/memcontrol.h:690 [inline]
folio_prealloc mm/memory.c:1011 [inline]
wp_page_copy mm/memory.c:3138 [inline]
do_wp_page+0x63a/0x1f20 mm/memory.c:3525
handle_pte_fault mm/memory.c:5160 [inline]
__handle_mm_fault mm/memory.c:5285 [inline]
handle_mm_fault+0xb80/0x27b0 mm/memory.c:5450
do_user_addr_fault arch/x86/mm/fault.c:1364 [inline]
handle_page_fault arch/x86/mm/fault.c:1507 [inline]
exc_page_fault+0x3ff/0x6d0 arch/x86/mm/fault.c:1563
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

value changed: 0x00000031 -> 0x00000040

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 11139 Comm: syz-executor.5 Not tainted 6.7.0-syzkaller-11091-g296455ade1fd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
==================================================================
syz-executor.5 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=1000
CPU: 1 PID: 11139 Comm: syz-executor.5 Not tainted 6.7.0-syzkaller-11091-g296455ade1fd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xda/0x130 lib/dump_stack.c:106
dump_stack+0x15/0x20 lib/dump_stack.c:113
dump_header+0x82/0x2d0 mm/oom_kill.c:461
oom_kill_process+0x33a/0x4c0 mm/oom_kill.c:1032
out_of_memory+0x9ca/0xbf0 mm/oom_kill.c:1170
mem_cgroup_out_of_memory+0x139/0x190 mm/memcontrol.c:1811
mem_cgroup_oom mm/memcontrol.c:2041 [inline]
try_charge_memcg+0x759/0xd20 mm/memcontrol.c:2810
try_charge mm/memcontrol.c:2904 [inline]
charge_memcg mm/memcontrol.c:7241 [inline]
mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7326
__read_swap_cache_async+0x2b9/0x510 mm/swap_state.c:498
swap_cluster_readahead+0x380/0x3f0 mm/swap_state.c:681
swapin_readahead+0xe2/0x7a0 mm/swap_state.c:886
do_swap_page+0x44c/0x1570 mm/memory.c:3898
handle_pte_fault mm/memory.c:5147 [inline]
__handle_mm_fault mm/memory.c:5285 [inline]
handle_mm_fault+0x7f6/0x27b0 mm/memory.c:5450
do_user_addr_fault arch/x86/mm/fault.c:1364 [inline]
handle_page_fault arch/x86/mm/fault.c:1507 [inline]
exc_page_fault+0x3ff/0x6d0 arch/x86/mm/fault.c:1563
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x7f399c301ac7
Code: 25 ff 0f 00 00 09 c5 80 3d 06 cc c9 00 00 0f 85 6f ff ff ff 44 0f b6 6c 24 0f 44 8d 55 04 89 e8 41 89 c1 41 81 e1 ff 1f 00 00 <43> 8b 14 8e 39 d5 0f 84 5e ff ff ff 85 d2 0f 84 65 01 00 00 83 c0
RSP: 002b:00007ffc2bc52480 EFLAGS: 00010202
RAX: 0000000081572b0d RBX: 00007f399c475018 RCX: 0000000000000080
RDX: ffffffff8157267e RSI: 0000000080000000 RDI: 00000000000083ff
RBP: 0000000081572b0d R08: 0000001b2c320000 R09: 0000000000000b0d
R10: 0000000081572b11 R11: 0000000000000246 R12: 0000000000000080
R13: 0000000000000001 R14: 00007f399c469000 R15: ffffffff8157267e
</TASK>
memory: usage 307200kB, limit 307200kB, failcnt 751098
memory+swap: usage 308676kB, limit 9007199254740988kB, failcnt 0
kmem: usage 307156kB, limit 9007199254740988kB, failcnt 0
Memory cgroup stats for /syz5:
cache 0
rss 32768
shmem 0
mapped_file 0
dirty 0
writeback 0
workingset_refault_anon 490592
workingset_refault_file 7
swap 1511424
swapcached 40960
pgpgin 1122636
pgpgout 1122626
pgfault 1537795
pgmajfault 345804
inactive_anon 20480
active_anon 12288
inactive_file 0
active_file 0
unevictable 0
hierarchical_memory_limit 314572800
hierarchical_memsw_limit 9223372036854771712
total_cache 0
total_rss 32768
total_shmem 0
total_mapped_file 0
total_dirty 0
total_writeback 0
total_workingset_refault_anon 490592
total_workingset_refault_file 7
total_swap 1511424
total_swapcached 40960
total_pgpgin 1122636
total_pgpgout 1122626
total_pgfault 1537795
total_pgmajfault 345804
total_inactive_anon 20480
total_active_anon 12288
total_inactive_file 0
total_active_file 0
total_unevictable 0
oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz5,mems_allowed=0,oom_memcg=/syz5,task_memcg=/syz5,task=syz-executor.5,pid=11139,uid=0
Memory cgroup out of memory: Killed process 11139 (syz-executor.5) total-vm:46308kB, anon-rss:380kB, file-rss:8832kB, shmem-rss:0kB, UID:0 pgtables:76kB oom_score_adj:1000


---
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 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
Reply all
Reply to author
Forward
0 new messages