syzbot


KCSAN: data-race in __delete_from_swap_cache / folio_mapping (5)

Status: moderation: reported on 2024/10/13 23:56
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+391379784937fd5bf87e@syzkaller.appspotmail.com
First crash: 2d00h, last: 2d00h
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __delete_from_swap_cache / folio_mapping (4) mm 8 63d 133d 0/28 auto-obsoleted due to no activity on 2024/09/17 23:01
upstream KCSAN: data-race in __delete_from_swap_cache / folio_mapping mm 2 300d 309d 0/28 auto-obsoleted due to no activity on 2024/01/24 15:33
upstream KCSAN: data-race in __delete_from_swap_cache / folio_mapping (2) mm 2 245d 257d 0/28 auto-obsoleted due to no activity on 2024/03/19 16:43
upstream KCSAN: data-race in __delete_from_swap_cache / folio_mapping (3) mm 1 197d 196d 0/28 auto-obsoleted due to no activity on 2024/05/06 15:11

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

write to 0xffffea0004a875a8 of 8 bytes by task 7037 on cpu 0:
 __delete_from_swap_cache+0x1f0/0x290 mm/swap_state.c:163
 delete_from_swap_cache+0x72/0xe0 mm/swap_state.c:243
 shmem_swapin_folio+0xb0a/0xbe0 mm/shmem.c:2204
 shmem_get_folio_gfp+0x26e/0xd90 mm/shmem.c:2268
 shmem_fault+0xfa/0x250 mm/shmem.c:2536
 __do_fault+0xb6/0x200 mm/memory.c:4876
 do_read_fault mm/memory.c:5282 [inline]
 do_fault mm/memory.c:5416 [inline]
 do_pte_missing mm/memory.c:3965 [inline]
 handle_pte_fault mm/memory.c:5751 [inline]
 __handle_mm_fault mm/memory.c:5894 [inline]
 handle_mm_fault+0xe7f/0x2a80 mm/memory.c:6062
 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x3b9/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

read to 0xffffea0004a875a8 of 8 bytes by task 7033 on cpu 1:
 folio_mapping+0xdb/0x120 mm/util.c:853
 folio_evictable mm/internal.h:389 [inline]
 evict_folios+0x2377/0x3140 mm/vmscan.c:4590
 try_to_shrink_lruvec+0x5d2/0x700 mm/vmscan.c:4778
 lru_gen_shrink_lruvec mm/vmscan.c:4920 [inline]
 shrink_lruvec+0x22d/0x1840 mm/vmscan.c:5675
 shrink_node_memcgs mm/vmscan.c:5911 [inline]
 shrink_node+0x615/0x1d40 mm/vmscan.c:5951
 shrink_zones mm/vmscan.c:6195 [inline]
 do_try_to_free_pages+0x3c6/0xc50 mm/vmscan.c:6257
 try_to_free_mem_cgroup_pages+0x1e3/0x490 mm/vmscan.c:6589
 try_charge_memcg+0x2bc/0x810 mm/memcontrol.c:2207
 obj_cgroup_charge_pages+0xbd/0x1a0 mm/memcontrol.c:2623
 __memcg_kmem_charge_page+0x9d/0x170 mm/memcontrol.c:2650
 __alloc_pages_noprof+0x1bc/0x340 mm/page_alloc.c:4750
 alloc_pages_mpol_noprof+0xb1/0x1e0 mm/mempolicy.c:2265
 alloc_pages_noprof+0xe1/0x100 mm/mempolicy.c:2345
 vm_area_alloc_pages mm/vmalloc.c:3568 [inline]
 __vmalloc_area_node mm/vmalloc.c:3646 [inline]
 __vmalloc_node_range_noprof+0x72e/0xec0 mm/vmalloc.c:3828
 __kvmalloc_node_noprof+0x121/0x170 mm/util.c:680
 ip_set_alloc+0x1f/0x30 net/netfilter/ipset/ip_set_core.c:256
 hash_netiface_create+0x273/0x730 net/netfilter/ipset/ip_set_hash_gen.h:1568
 ip_set_create+0x359/0x8a0 net/netfilter/ipset/ip_set_core.c:1104
 nfnetlink_rcv_msg+0x4a9/0x570 net/netfilter/nfnetlink.c:302
 netlink_rcv_skb+0x12c/0x230 net/netlink/af_netlink.c:2551
 nfnetlink_rcv+0x16c/0x15c0 net/netfilter/nfnetlink.c:667
 netlink_unicast_kernel net/netlink/af_netlink.c:1331 [inline]
 netlink_unicast+0x599/0x670 net/netlink/af_netlink.c:1357
 netlink_sendmsg+0x5cc/0x6e0 net/netlink/af_netlink.c:1901
 sock_sendmsg_nosec net/socket.c:729 [inline]
 __sock_sendmsg+0x140/0x180 net/socket.c:744
 ____sys_sendmsg+0x312/0x410 net/socket.c:2607
 ___sys_sendmsg net/socket.c:2661 [inline]
 __sys_sendmsg+0x1d9/0x270 net/socket.c:2690
 __do_sys_sendmsg net/socket.c:2699 [inline]
 __se_sys_sendmsg net/socket.c:2697 [inline]
 __x64_sys_sendmsg+0x46/0x50 net/socket.c:2697
 x64_sys_call+0x2689/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:47
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x000000000000025c -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 7033 Comm: syz.2.1173 Not tainted 6.12.0-rc2-syzkaller-00307-g36c254515dc6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/13 23:55 upstream 36c254515dc6 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __delete_from_swap_cache / folio_mapping
* Struck through repros no longer work on HEAD.