syzbot


KCSAN: data-race in __delete_from_swap_cache / folio_mapping

Status: auto-obsoleted due to no activity on 2024/01/24 15:33
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+97bb2bfb6d0864ed7c9f@syzkaller.appspotmail.com
First crash: 189d, last: 156d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __delete_from_swap_cache / folio_mapping (2) mm 2 101d 113d 0/26 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 53d 52d 0/26 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 0xffffea00049c8568 of 8 bytes by task 9417 on cpu 1:
 __delete_from_swap_cache+0x1f2/0x290 mm/swap_state.c:160
 delete_from_swap_cache+0x72/0xd0 mm/swap_state.c:240
 folio_free_swap+0x19f/0x1c0 mm/swapfile.c:1589
 __try_to_reclaim_swap mm/swapfile.c:154 [inline]
 free_swap_and_cache+0x22e/0x2d0 mm/swapfile.c:1611
 shmem_free_swap mm/shmem.c:841 [inline]
 shmem_undo_range+0x2b6/0xa40 mm/shmem.c:994
 shmem_truncate_range mm/shmem.c:1113 [inline]
 shmem_fallocate+0x2e3/0x860 mm/shmem.c:3093
 vfs_fallocate+0x378/0x3e0 fs/open.c:324
 ksys_fallocate fs/open.c:347 [inline]
 __do_sys_fallocate fs/open.c:355 [inline]
 __se_sys_fallocate fs/open.c:353 [inline]
 __x64_sys_fallocate+0x79/0xc0 fs/open.c:353
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffffea00049c8568 of 8 bytes by task 9409 on cpu 0:
 folio_mapping+0xca/0x110 mm/util.c:780
 folio_evictable mm/internal.h:162 [inline]
 move_folios_to_lru+0x132/0x690 mm/vmscan.c:1800
 shrink_inactive_list mm/vmscan.c:1916 [inline]
 shrink_list mm/vmscan.c:2154 [inline]
 shrink_lruvec+0xd98/0x17a0 mm/vmscan.c:5656
 shrink_node_memcgs mm/vmscan.c:5842 [inline]
 shrink_node+0xab3/0x15c0 mm/vmscan.c:5877
 shrink_zones mm/vmscan.c:6116 [inline]
 do_try_to_free_pages+0x43d/0xce0 mm/vmscan.c:6178
 try_to_free_mem_cgroup_pages+0x1e2/0x480 mm/vmscan.c:6493
 try_charge_memcg+0x280/0xd30 mm/memcontrol.c:2742
 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3255
 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3281
 __alloc_pages+0x1bb/0x340 mm/page_alloc.c:4585
 alloc_pages_mpol+0xb1/0x1d0 mm/mempolicy.c:2133
 alloc_pages+0xe0/0x100 mm/mempolicy.c:2204
 vm_area_alloc_pages mm/vmalloc.c:3063 [inline]
 __vmalloc_area_node mm/vmalloc.c:3139 [inline]
 __vmalloc_node_range+0x6d2/0xea0 mm/vmalloc.c:3320
 kvmalloc_node+0x121/0x160 mm/util.c:642
 kvmalloc include/linux/slab.h:738 [inline]
 xt_alloc_table_info+0x3d/0x80 net/netfilter/x_tables.c:1192
 do_replace net/ipv4/netfilter/arp_tables.c:970 [inline]
 do_arpt_set_ctl+0x634/0x13b0 net/ipv4/netfilter/arp_tables.c:1421
 nf_setsockopt+0x18d/0x1b0 net/netfilter/nf_sockopt.c:101
 ip_setsockopt+0xe6/0x100 net/ipv4/ip_sockglue.c:1426
 tcp_setsockopt+0x90/0xa0 net/ipv4/tcp.c:3724
 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3711
 do_sock_setsockopt net/socket.c:2311 [inline]
 __sys_setsockopt+0x1d4/0x240 net/socket.c:2334
 __do_sys_setsockopt net/socket.c:2343 [inline]
 __se_sys_setsockopt net/socket.c:2340 [inline]
 __x64_sys_setsockopt+0x66/0x80 net/socket.c:2340
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x0000000000000772 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 9409 Comm: syz-executor.1 Not tainted 6.7.0-rc6-syzkaller-00022-g55cb5f43689d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/20 15:32 upstream 55cb5f43689d de21eb89 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __delete_from_swap_cache / folio_mapping
2023/11/18 03:39 upstream 6bc40e44f1dd cb976f63 .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.