==================================================================
BUG: KCSAN: data-race in __filemap_remove_folio / shmem_get_folio_gfp

read-write to 0xffff888134d0d158 of 8 bytes by task 21587 on cpu 0:
 page_cache_delete mm/filemap.c:150 [inline]
 __filemap_remove_folio+0x224/0x320 mm/filemap.c:228
 __remove_mapping+0x35b/0x480 mm/vmscan.c:1457
 shrink_folio_list+0x137a/0x2550 mm/vmscan.c:2102
 reclaim_folio_list+0x7b/0x1d0 mm/vmscan.c:2801
 reclaim_pages+0x220/0x280 mm/vmscan.c:2837
 madvise_cold_or_pageout_pte_range+0x82c/0x890 mm/madvise.c:529
 walk_pmd_range mm/pagewalk.c:143 [inline]
 walk_pud_range mm/pagewalk.c:221 [inline]
 walk_p4d_range mm/pagewalk.c:256 [inline]
 walk_pgd_range+0x7f4/0xe20 mm/pagewalk.c:293
 __walk_page_range+0xc2/0x320 mm/pagewalk.c:395
 walk_page_range+0x20b/0x330 mm/pagewalk.c:493
 madvise_pageout_page_range mm/madvise.c:587 [inline]
 madvise_pageout mm/madvise.c:614 [inline]
 madvise_vma_behavior mm/madvise.c:1035 [inline]
 madvise_walk_vmas mm/madvise.c:1264 [inline]
 do_madvise+0x1eea/0x29b0 mm/madvise.c:1444
 __do_sys_madvise mm/madvise.c:1457 [inline]
 __se_sys_madvise mm/madvise.c:1455 [inline]
 __x64_sys_madvise+0x60/0x70 mm/madvise.c:1455
 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 0xffff888134d0d158 of 8 bytes by task 21559 on cpu 1:
 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_shared_fault mm/memory.c:4602 [inline]
 do_fault mm/memory.c:4674 [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+0x131b/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+0x4a/0xb0 arch/x86/lib/copy_user_64.S:65
 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline]
 raw_copy_to_user arch/x86/include/asm/uaccess_64.h:133 [inline]
 copyout lib/iov_iter.c:168 [inline]
 _copy_to_iter+0x13c/0x910 lib/iov_iter.c:316
 copy_to_iter include/linux/uio.h:194 [inline]
 get_random_bytes_user+0x112/0x260 drivers/char/random.c:451
 __do_sys_getrandom drivers/char/random.c:1391 [inline]
 __se_sys_getrandom drivers/char/random.c:1364 [inline]
 __x64_sys_getrandom+0xcd/0x1a0 drivers/char/random.c:1364
 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: 0x0000000000000898 -> 0x0000000000000893

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 21559 Comm: syz-executor.2 Not tainted 6.5.0-rc5-syzkaller-00362-ga785fd28d31f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
==================================================================