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: 38d, last: 29d
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 99d 169d 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 336d 345d 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 281d 293d 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 233d 232d 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 0xffffea0005506968 of 8 bytes by task 22851 on cpu 1:
 __delete_from_swap_cache+0x1f0/0x290 mm/swap_state.c:163
 delete_from_swap_cache+0x72/0xe0 mm/swap_state.c:243
 folio_free_swap+0x1d8/0x1f0 mm/swapfile.c:1851
 do_swap_page+0x14d4/0x23e0 mm/memory.c:4522
 handle_pte_fault mm/memory.c:5758 [inline]
 __handle_mm_fault mm/memory.c:5898 [inline]
 handle_mm_fault+0x8c5/0x2a80 mm/memory.c:6066
 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x296/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

read to 0xffffea0005506968 of 8 bytes by task 22852 on cpu 0:
 folio_mapping+0xdb/0x120 mm/util.c:853
 folio_evictable mm/internal.h:389 [inline]
 sort_folio mm/vmscan.c:4298 [inline]
 scan_folios mm/vmscan.c:4415 [inline]
 isolate_folios mm/vmscan.c:4540 [inline]
 evict_folios+0x820/0x3140 mm/vmscan.c:4571
 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+0x5f3/0x1d60 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: 0x00000000000001e7 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 22852 Comm: +}[@ Not tainted 6.12.0-rc4-syzkaller-00047-gc2ee9f594da8 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/23 02:11 upstream c2ee9f594da8 15fa2979 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __delete_from_swap_cache / folio_mapping
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.