syzbot


KCSAN: data-race in __lru_add_drain_all / folio_add_lru

Status: moderation: reported on 2021/12/14 17:42
Reported-by: syzbot+d676f4fcc6452f55d1d0@syzkaller.appspotmail.com
First crash: 453d, last: 1d11h

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __lru_add_drain_all / folio_add_lru

read-write to 0xffff888237c27bf8 of 1 bytes by task 9555 on cpu 0:
 folio_batch_add include/linux/pagevec.h:129 [inline]
 folio_batch_add_and_move mm/swap.c:261 [inline]
 folio_add_lru+0x5a/0x140 mm/swap.c:547
 folio_add_lru_vma+0x44/0x60 mm/swap.c:567
 lru_cache_add_inactive_or_unevictable+0x45/0xf0 mm/folio-compat.c:82
 wp_page_copy+0x933/0x1710 mm/memory.c:3158
 do_wp_page+0x22a/0x640 mm/memory.c:3447
 handle_pte_fault mm/memory.c:4949 [inline]
 __handle_mm_fault mm/memory.c:5073 [inline]
 handle_mm_fault+0x644/0xb20 mm/memory.c:5219
 do_user_addr_fault+0x4a1/0x980 arch/x86/mm/fault.c:1428
 handle_page_fault arch/x86/mm/fault.c:1519 [inline]
 exc_page_fault+0x60/0x160 arch/x86/mm/fault.c:1575
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
 __put_user_nocheck_4+0x3/0x10 arch/x86/lib/putuser.S:98
 ____sys_recvmsg+0x215/0x2e0 net/socket.c:2708
 ___sys_recvmsg net/socket.c:2737 [inline]
 do_recvmmsg+0x2f1/0x710 net/socket.c:2831
 __sys_recvmmsg net/socket.c:2910 [inline]
 __do_sys_recvmmsg net/socket.c:2933 [inline]
 __se_sys_recvmmsg net/socket.c:2926 [inline]
 __x64_sys_recvmmsg+0xde/0x160 net/socket.c:2926
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff888237c27bf8 of 1 bytes by task 9548 on cpu 1:
 folio_batch_count include/linux/pagevec.h:108 [inline]
 cpu_needs_drain mm/swap.c:829 [inline]
 __lru_add_drain_all+0x134/0x3c0 mm/swap.c:923
 lru_add_drain_all+0xc/0x10 mm/swap.c:939
 invalidate_bdev+0x56/0x80 block/bdev.c:86
 invalidate_disk+0x25/0xb0 block/genhd.c:693
 __loop_clr_fd+0x176/0x3c0 drivers/block/loop.c:1164
 loop_clr_fd drivers/block/loop.c:1257 [inline]
 lo_ioctl+0xd8c/0x1290 drivers/block/loop.c:1563
 blkdev_ioctl+0x215/0x440 block/ioctl.c:616
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:856
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x0b -> 0x0c

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 9548 Comm: syz-executor.2 Not tainted 6.2.0-rc5-syzkaller-00108-g83abd4d4c4be-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
==================================================================

Crashes (498):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci2-upstream-kcsan-gce 2023/01/28 05:24 upstream 83abd4d4c4be 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/26 22:08 upstream 7c46948a6e9c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/22 11:27 upstream 2241ab53cbb5 cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/19 14:53 upstream 7287904c8771 66fca3ae .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/17 20:11 upstream 6e50979a9c87 42660d9e .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/15 20:09 upstream 7c6984405241 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/11 22:40 upstream 7dd4b804e080 96166539 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/09 14:28 upstream 1fe4fd6f5cad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/08 19:11 upstream 9b43a525db12 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/07 15:43 upstream 0a71553536d2 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/06 15:44 upstream 41c03ba9beea 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2023/01/02 19:22 upstream 88603b6dc419 ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/31 21:47 upstream c8451c141e07 ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/31 13:02 upstream bff687b3dad6 ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/30 04:12 upstream 2258c2dc850b 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/27 20:08 upstream 1b929c02afd3 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/26 15:15 upstream 1b929c02afd3 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/24 21:51 upstream 72a85e2b0a1e 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/23 22:38 upstream 51094a24b85e 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/23 05:00 upstream 0a924817d2ed 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/16 09:53 upstream 851f657a8642 6f9c033e .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/09 06:08 upstream f3e8416619ce 1034e5fa .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/08 14:22 upstream 479174d402bc d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/07 19:20 upstream 8ed710da2873 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/12/04 18:11 upstream c2bf05db6c78 e080de16 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/27 18:01 upstream faf68e3523c2 f4470a7b .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/24 09:13 upstream 4312098baf37 ff68ff8f .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/24 01:19 upstream eb7081409f94 52fdf57a .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/22 08:30 upstream eb7081409f94 1c576c23 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/21 06:08 upstream eb7081409f94 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/20 23:34 upstream 77c51ba552a1 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/19 12:11 upstream ab290eaddc4c 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/14 02:29 upstream af7a05689189 7ba4d859 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/13 07:14 upstream fef7fd48922d f42ee5d8 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/09 14:03 upstream f141df371335 bebca8b7 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/08 11:15 upstream 59f2f4b8a757 6feb842b .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/06 23:53 upstream 089d1c31224e 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/06 14:33 upstream 2f5065a0bc9d 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/06 14:21 upstream 2f5065a0bc9d 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/11/04 21:09 upstream ee6050c8af96 6d752409 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/31 22:41 upstream 30a0b95b1335 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/30 15:33 upstream 882ad2a2a8ff 2a71366b .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/29 10:37 upstream 576e61cea1e4 899d812a .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/28 07:46 upstream 23758867219c 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/27 17:52 upstream b229b6ca5abb 5c716ff6 .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/26 22:35 upstream 4dc12f37a8e9 86777b7f .config console log report info [disk image] [vmlinux] [kernel image] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/25 13:30 upstream 337a0a0b63f1 45645420 .config console log report info [disk image] [vmlinux] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/22 19:42 upstream 440b7895c990 c0b80a55 .config console log report info [disk image] [vmlinux] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2022/10/21 13:20 upstream 6d36c728bc2e 63e790dd .config console log report info [disk image] [vmlinux] KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2021/12/14 16:36 upstream 5472f14a3742 d018dd31 .config console log report info KCSAN: data-race in __lru_add_drain_all / folio_add_lru
ci2-upstream-kcsan-gce 2021/11/02 13:42 upstream bfc484fe6abb 098b5d53 .config console log report info KCSAN: data-race in __lru_add_drain_all / folio_add_lru
* Struck through repros no longer work on HEAD.