[moderation] [mm?] KCSAN: data-race in __lru_add_drain_all / folios_put_refs

0 views
Skip to first unread message

syzbot

unread,
Apr 7, 2024, 7:10:28 PMApr 7
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9fe30842a90b Merge tag 'x86-urgent-2024-04-07' of git://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15a32e05180000
kernel config: https://syzkaller.appspot.com/x/.config?x=d024e89f7bb376ce
dashboard link: https://syzkaller.appspot.com/bug?extid=ec770cf118c16e8397fa
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [ak...@linux-foundation.org linux-...@vger.kernel.org linu...@kvack.org]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e21ac82e3d84/disk-9fe30842.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/75bdfd5dc2d1/vmlinux-9fe30842.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ca4a4c469831/bzImage-9fe30842.xz

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

loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
==================================================================
BUG: KCSAN: data-race in __lru_add_drain_all / folios_put_refs

write to 0xffff888237c2ac08 of 1 bytes by task 6674 on cpu 0:
folio_batch_reinit include/linux/pagevec.h:50 [inline]
folios_put_refs+0x293/0x2e0 mm/swap.c:1028
folios_put include/linux/mm.h:1565 [inline]
folio_batch_move_lru+0x298/0x2c0 mm/swap.c:240
folio_batch_add_and_move mm/swap.c:249 [inline]
folio_add_lru mm/swap.c:532 [inline]
folio_add_lru_vma+0x105/0x170 mm/swap.c:552
wp_page_copy mm/memory.c:3331 [inline]
do_wp_page+0x1556/0x1e70 mm/memory.c:3660
handle_pte_fault mm/memory.c:5316 [inline]
__handle_mm_fault mm/memory.c:5441 [inline]
handle_mm_fault+0xb7f/0x27e0 mm/memory.c:5606
do_user_addr_fault arch/x86/mm/fault.c:1362 [inline]
handle_page_fault arch/x86/mm/fault.c:1505 [inline]
exc_page_fault+0x3eb/0x6d0 arch/x86/mm/fault.c:1563
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

read to 0xffff888237c2ac08 of 1 bytes by task 6632 on cpu 1:
folio_batch_count include/linux/pagevec.h:56 [inline]
cpu_needs_drain mm/swap.c:810 [inline]
__lru_add_drain_all+0x137/0x420 mm/swap.c:904
lru_add_drain_all+0x10/0x20 mm/swap.c:920
invalidate_bdev+0x54/0x80 block/bdev.c:95
invalidate_disk+0x29/0x70 block/genhd.c:747
__loop_clr_fd+0x191/0x3f0 drivers/block/loop.c:1160
loop_clr_fd drivers/block/loop.c:1253 [inline]
lo_ioctl+0xea6/0x1330 drivers/block/loop.c:1555
blkdev_ioctl+0x37f/0x470 block/ioctl.c:641
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:904 [inline]
__se_sys_ioctl+0xd3/0x150 fs/ioctl.c:890
__x64_sys_ioctl+0x43/0x50 fs/ioctl.c:890
do_syscall_64+0xd3/0x1d0
entry_SYSCALL_64_after_hwframe+0x72/0x7a

value changed: 0x1f -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 6632 Comm: syz-executor.2 Tainted: G W 6.9.0-rc2-syzkaller-00435-g9fe30842a90b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
==================================================================
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764
loop2: detected capacity change from 0 to 1764


---
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.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages