================================================================== BUG: KCSAN: data-race in shmem_add_to_page_cache / shmem_get_folio_gfp read-write to 0xffff88813c4a1d38 of 8 bytes by task 6414 on cpu 1: shmem_add_to_page_cache+0x40a/0x510 mm/shmem.c:742 shmem_get_folio_gfp+0x923/0x1200 mm/shmem.c:1978 shmem_fault+0xe6/0x3f0 mm/shmem.c:2163 __do_fault mm/memory.c:4198 [inline] do_read_fault mm/memory.c:4547 [inline] do_fault mm/memory.c:4670 [inline] do_pte_missing mm/memory.c:3664 [inline] handle_pte_fault mm/memory.c:4939 [inline] __handle_mm_fault mm/memory.c:5079 [inline] handle_mm_fault+0x1224/0x2c10 mm/memory.c:5233 do_user_addr_fault arch/x86/mm/fault.c:1392 [inline] handle_page_fault arch/x86/mm/fault.c:1486 [inline] exc_page_fault+0x24d/0x650 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 rep_movs_alternative+0x30/0xb0 arch/x86/lib/copy_user_64.S:50 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:127 [inline] _copy_from_user+0x80/0xd0 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:183 [inline] copy_msghdr_from_user+0x54/0x2a0 net/socket.c:2424 recvmsg_copy_msghdr net/socket.c:2679 [inline] ___sys_recvmsg net/socket.c:2751 [inline] do_recvmmsg+0x290/0x720 net/socket.c:2849 __sys_recvmmsg net/socket.c:2928 [inline] __do_sys_recvmmsg net/socket.c:2951 [inline] __se_sys_recvmmsg net/socket.c:2944 [inline] __x64_sys_recvmmsg+0xe2/0x160 net/socket.c:2944 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff88813c4a1d38 of 8 bytes by task 6425 on cpu 0: shmem_recalc_inode mm/shmem.c:360 [inline] shmem_get_folio_gfp+0xe1e/0x1200 mm/shmem.c:1988 shmem_fault+0xe6/0x3f0 mm/shmem.c:2163 __do_fault mm/memory.c:4198 [inline] do_read_fault mm/memory.c:4547 [inline] do_fault mm/memory.c:4670 [inline] do_pte_missing mm/memory.c:3664 [inline] handle_pte_fault mm/memory.c:4939 [inline] __handle_mm_fault mm/memory.c:5079 [inline] handle_mm_fault+0x1224/0x2c10 mm/memory.c:5233 do_user_addr_fault arch/x86/mm/fault.c:1392 [inline] handle_page_fault arch/x86/mm/fault.c:1486 [inline] exc_page_fault+0x24d/0x650 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 fault_in_readable+0xf8/0x1b0 fault_in_iov_iter_readable+0x82/0x180 lib/iov_iter.c:216 generic_perform_write+0x10c/0x410 mm/filemap.c:3913 __generic_file_write_iter+0xa1/0x120 mm/filemap.c:4018 generic_file_write_iter+0x7d/0x1c0 mm/filemap.c:4044 call_write_iter include/linux/fs.h:1871 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x4ab/0x7d0 fs/read_write.c:584 ksys_write+0xeb/0x1a0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x42/0x50 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x00000000000000c9 -> 0x00000000000000ca Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 6425 Comm: syz-executor.5 Not tainted 6.5.0-rc3-syzkaller-00297-gd31e3792919e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 ==================================================================