================================================================== BUG: KCSAN: data-race in do_try_to_free_pages / do_try_to_free_pages write to 0xffff888135942870 of 8 bytes by task 20722 on cpu 0: snapshot_refaults mm/vmscan.c:6109 [inline] do_try_to_free_pages+0x95f/0xce0 mm/vmscan.c:6171 try_to_free_mem_cgroup_pages+0x1e2/0x480 mm/vmscan.c:6463 try_charge_memcg+0x280/0xd30 mm/memcontrol.c:2742 obj_cgroup_charge_pages+0xab/0x130 mm/memcontrol.c:3254 __memcg_kmem_charge_page+0x9c/0x170 mm/memcontrol.c:3280 __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:632 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:3704 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3711 do_sock_setsockopt net/socket.c:2315 [inline] __sys_setsockopt+0x1d4/0x240 net/socket.c:2338 __do_sys_setsockopt net/socket.c:2347 [inline] __se_sys_setsockopt net/socket.c:2344 [inline] __x64_sys_setsockopt+0x66/0x80 net/socket.c:2344 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b write to 0xffff888135942870 of 8 bytes by task 20718 on cpu 1: snapshot_refaults mm/vmscan.c:6109 [inline] do_try_to_free_pages+0x95f/0xce0 mm/vmscan.c:6171 try_to_free_mem_cgroup_pages+0x1e2/0x480 mm/vmscan.c:6463 try_charge_memcg+0x280/0xd30 mm/memcontrol.c:2742 try_charge mm/memcontrol.c:2884 [inline] charge_memcg mm/memcontrol.c:7209 [inline] mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7294 __read_swap_cache_async+0x2f6/0x550 mm/swap_state.c:490 swap_cluster_readahead+0x27c/0x4c0 mm/swap_state.c:655 swapin_readahead+0xe9/0x7f0 mm/swap_state.c:878 do_swap_page+0x4a0/0x1670 mm/memory.c:3883 handle_pte_fault mm/memory.c:5041 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0xa36/0x2dd0 mm/memory.c:5344 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2f7/0x6c0 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 __get_user_8+0x11/0x20 arch/x86/lib/getuser.S:85 rseq_get_rseq_cs kernel/rseq.c:161 [inline] rseq_ip_fixup kernel/rseq.c:281 [inline] __rseq_handle_notify_resume+0xc7/0xbf0 kernel/rseq.c:329 rseq_handle_notify_resume include/linux/sched.h:2361 [inline] resume_user_mode_work include/linux/resume_user_mode.h:61 [inline] exit_to_user_mode_loop+0xcc/0xe0 kernel/entry/common.c:171 exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204 irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:309 irqentry_exit+0x12/0x40 kernel/entry/common.c:412 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 value changed: 0x00000000000001a6 -> 0x00000000000001a7 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 20718 Comm: syz-executor.3 Not tainted 6.6.0-syzkaller-15029-gbe3ca57cfb77 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 ================================================================== syz-executor.3 invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=1000 CPU: 1 PID: 20718 Comm: syz-executor.3 Not tainted 6.6.0-syzkaller-15029-gbe3ca57cfb77 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __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:460 oom_kill_process+0x33a/0x4c0 mm/oom_kill.c:1031 out_of_memory+0x9ca/0xbf0 mm/oom_kill.c:1169 mem_cgroup_out_of_memory+0x139/0x190 mm/memcontrol.c:1791 mem_cgroup_oom mm/memcontrol.c:2021 [inline] try_charge_memcg+0x75c/0xd30 mm/memcontrol.c:2790 try_charge mm/memcontrol.c:2884 [inline] charge_memcg mm/memcontrol.c:7209 [inline] mem_cgroup_swapin_charge_folio+0x107/0x190 mm/memcontrol.c:7294 __read_swap_cache_async+0x2f6/0x550 mm/swap_state.c:490 swap_cluster_readahead+0x27c/0x4c0 mm/swap_state.c:655 swapin_readahead+0xe9/0x7f0 mm/swap_state.c:878 do_swap_page+0x4a0/0x1670 mm/memory.c:3883 handle_pte_fault mm/memory.c:5041 [inline] __handle_mm_fault mm/memory.c:5179 [inline] handle_mm_fault+0xa36/0x2dd0 mm/memory.c:5344 do_user_addr_fault arch/x86/mm/fault.c:1413 [inline] handle_page_fault arch/x86/mm/fault.c:1505 [inline] exc_page_fault+0x2f7/0x6c0 arch/x86/mm/fault.c:1561 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:__get_user_8+0x11/0x20 arch/x86/lib/getuser.S:88 Code: 48 c1 fa 3f 48 09 d0 0f 01 cb 8b 10 31 c0 0f 01 ca c3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 89 c2 48 c1 fa 3f 48 09 d0 0f 01 cb <48> 8b 10 31 c0 0f 01 ca c3 66 0f 1f 44 00 00 f3 0f 1e fa 0f 01 cb RSP: 0000:ffffc9000064be38 EFLAGS: 00050202 RAX: 00005555569f5da8 RBX: ffffc9000064be40 RCX: ffffffff81442dd3 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff888140d909d0 RBP: ffffc9000064bef8 R08: 0001888140d909d7 R09: 0000000000000000 R10: 0001ffffffffffff R11: 0001888140d90690 R12: ffff888140d90000 R13: ffff888140d909d0 R14: ffffc9000064bf58 R15: ffffc9000064bfd8 rseq_get_rseq_cs kernel/rseq.c:161 [inline] rseq_ip_fixup kernel/rseq.c:281 [inline] __rseq_handle_notify_resume+0xc7/0xbf0 kernel/rseq.c:329 rseq_handle_notify_resume include/linux/sched.h:2361 [inline] resume_user_mode_work include/linux/resume_user_mode.h:61 [inline] exit_to_user_mode_loop+0xcc/0xe0 kernel/entry/common.c:171 exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204 irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:309 irqentry_exit+0x12/0x40 kernel/entry/common.c:412 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0033:0x7fbc72968ae4 Code: 01 00 00 69 3d c9 eb c8 00 e8 03 00 00 48 8d 1d b2 54 16 00 e8 9d 5f 04 00 eb 0f 0f 1f 00 48 81 c3 d0 00 00 00 48 39 eb 74 be <80> 7b 20 00 74 ee 8b 43 0c 85 c0 74 e7 48 89 df e8 f7 ee ff ff eb RSP: 002b:00007ffd46d41f60 EFLAGS: 00010202 RAX: 0000000000000000 RBX: 00007fbc72acdf80 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00005555569f5788 RBP: 00007fbc72acf980 R08: 0000000000000000 R09: 00007ffd46dec0b0 R10: 0000000000000000 R11: 0000000000000293 R12: 00000000001563de R13: ffffffffffffffff R14: 00007fbc72532000 R15: 000000000015609d memory: usage 307200kB, limit 307200kB, failcnt 26585 memory+swap: usage 308152kB, limit 9007199254740988kB, failcnt 0 kmem: usage 307168kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz3: cache 12288 rss 8192 shmem 0 mapped_file 0 dirty 8192 writeback 4096 workingset_refault_anon 3187 workingset_refault_file 23 swap 974848 swapcached 20480 pgpgin 1894629 pgpgout 1894621 pgfault 1812653 pgmajfault 1210 inactive_anon 4096 active_anon 0 inactive_file 0 active_file 12288 unevictable 0 hierarchical_memory_limit 314572800 hierarchical_memsw_limit 9223372036854771712 total_cache 12288 total_rss 8192 total_shmem 0 total_mapped_file 0 total_dirty 8192 total_writeback 4096 total_workingset_refault_anon 3187 total_workingset_refault_file 23 total_swap 974848 total_swapcached 20480 total_pgpgin 1894629 total_pgpgout 1894621 total_pgfault 1812653 total_pgmajfault 1210 total_inactive_anon 4096 total_active_anon 0 total_inactive_file 0 total_active_file 12288 total_unevictable 0 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz3,mems_allowed=0,oom_memcg=/syz3,task_memcg=/syz3,task=syz-executor.3,pid=20718,uid=0 Memory cgroup out of memory: Killed process 20718 (syz-executor.3) total-vm:46428kB, anon-rss:380kB, file-rss:8960kB, shmem-rss:0kB, UID:0 pgtables:84kB oom_score_adj:1000 ---------------- Code disassembly (best guess): 0: 48 c1 fa 3f sar $0x3f,%rdx 4: 48 09 d0 or %rdx,%rax 7: 0f 01 cb stac a: 8b 10 mov (%rax),%edx c: 31 c0 xor %eax,%eax e: 0f 01 ca clac 11: c3 ret 12: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 19: f3 0f 1e fa endbr64 1d: 48 89 c2 mov %rax,%rdx 20: 48 c1 fa 3f sar $0x3f,%rdx 24: 48 09 d0 or %rdx,%rax 27: 0f 01 cb stac * 2a: 48 8b 10 mov (%rax),%rdx <-- trapping instruction 2d: 31 c0 xor %eax,%eax 2f: 0f 01 ca clac 32: c3 ret 33: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 39: f3 0f 1e fa endbr64 3d: 0f 01 cb stac