KCSAN: data-race in __lru_add_drain_all / folio_add_lru

11 views
Skip to first unread message

syzbot

unread,
Dec 14, 2021, 12:42:27 PM12/14/21
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 5472f14a3742 Merge tag 'for_linus' of git://git.kernel.org..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1140d66db00000
kernel config: https://syzkaller.appspot.com/x/.config?x=de0414680adf699a
dashboard link: https://syzkaller.appspot.com/bug?extid=d676f4fcc6452f55d1d0
compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2
CC: [ak...@linux-foundation.org linux-...@vger.kernel.org linu...@kvack.org]

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d676f4...@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in __lru_add_drain_all / folio_add_lru

write to 0xffff888237c277c8 of 1 bytes by task 20128 on cpu 0:
pagevec_add include/linux/pagevec.h:74 [inline]
pagevec_add_and_need_flush mm/swap.c:236 [inline]
folio_add_lru+0x62/0x160 mm/swap.c:468
lru_cache_add+0x37/0x50 mm/folio-compat.c:108
lru_cache_add_inactive_or_unevictable+0x46/0x140 mm/swap.c:500
wp_page_copy+0x781/0x10e0 mm/memory.c:3047
do_wp_page+0x4fb/0xa80
handle_pte_fault mm/memory.c:4569 [inline]
__handle_mm_fault mm/memory.c:4686 [inline]
handle_mm_fault+0x975/0x1590 mm/memory.c:4784
do_user_addr_fault+0x609/0xbe0 arch/x86/mm/fault.c:1397
handle_page_fault arch/x86/mm/fault.c:1485 [inline]
exc_page_fault+0x91/0x290 arch/x86/mm/fault.c:1541
asm_exc_page_fault+0x1e/0x30

read to 0xffff888237c277c8 of 1 bytes by task 20125 on cpu 1:
pagevec_count include/linux/pagevec.h:61 [inline]
__lru_add_drain_all+0x12c/0x3e0 mm/swap.c:835
lru_add_drain_all+0xc/0x10 mm/swap.c:857
invalidate_bdev+0x56/0x80 block/bdev.c:88
invalidate_disk+0x25/0xb0 block/genhd.c:651
__loop_clr_fd+0x41f/0x6c0 drivers/block/loop.c:1147
loop_clr_fd drivers/block/loop.c:1237 [inline]
lo_ioctl+0x985/0x1270 drivers/block/loop.c:1562
blkdev_ioctl+0x20e/0x440 block/ioctl.c:609
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:874 [inline]
__se_sys_ioctl+0xcb/0x140 fs/ioctl.c:860
__x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:860
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x0b -> 0x0c

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 20125 Comm: syz-executor.3 Not tainted 5.16.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
Reply all
Reply to author
Forward
0 new messages