syzbot


KCSAN: data-race in __lru_add_drain_all / folio_activate (5)

Status: moderation: reported on 2024/04/24 22:06
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+a0daad591f6e1466327b@syzkaller.appspotmail.com
First crash: 35d, last: 10d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in __lru_add_drain_all / folio_activate mm 2 576d 595d 0/26 auto-obsoleted due to no activity on 2022/12/05 13:00
upstream KCSAN: data-race in __lru_add_drain_all / folio_activate (3) mm 1 402d 402d 0/26 auto-obsoleted due to no activity on 2023/05/29 00:21
upstream KCSAN: data-race in __lru_add_drain_all / folio_activate (2) mm 2 472d 509d 0/26 auto-obsoleted due to no activity on 2023/04/01 02:31
upstream KCSAN: data-race in __lru_add_drain_all / folio_activate (4) mm 23 110d 173d 0/26 auto-obsoleted due to no activity on 2024/03/16 06:00

Sample crash report:
EXT4-fs (loop1): unmounting filesystem 00000000-0000-0000-0000-000000000000.
==================================================================
BUG: KCSAN: data-race in __lru_add_drain_all / folio_activate

read-write to 0xffff888237d2b008 of 1 bytes by task 19514 on cpu 1:
 folio_batch_add include/linux/pagevec.h:77 [inline]
 folio_batch_add_and_move mm/swap.c:233 [inline]
 folio_activate+0xb7/0x1c0 mm/swap.c:363
 folio_mark_accessed+0x11d/0x190 mm/swap.c:486
 zap_present_folio_ptes mm/memory.c:1490 [inline]
 zap_present_ptes mm/memory.c:1570 [inline]
 zap_pte_range mm/memory.c:1612 [inline]
 zap_pmd_range mm/memory.c:1730 [inline]
 zap_pud_range mm/memory.c:1759 [inline]
 zap_p4d_range mm/memory.c:1780 [inline]
 unmap_page_range+0xf00/0x23f0 mm/memory.c:1801
 unmap_single_vma+0x142/0x1d0 mm/memory.c:1847
 unmap_vmas+0x18d/0x2b0 mm/memory.c:1891
 exit_mmap+0x18f/0x710 mm/mmap.c:3312
 __mmput+0x28/0x1c0 kernel/fork.c:1346
 mmput+0x4c/0x60 kernel/fork.c:1368
 exit_mm+0xe4/0x190 kernel/exit.c:568
 do_exit+0x57e/0x1740 kernel/exit.c:864
 do_group_exit+0x102/0x150 kernel/exit.c:1026
 get_signal+0xf2f/0x1080 kernel/signal.c:2911
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x59/0x130 kernel/entry/common.c:218
 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888237d2b008 of 1 bytes by task 19155 on cpu 0:
 folio_batch_count include/linux/pagevec.h:56 [inline]
 cpu_needs_drain mm/swap.c:805 [inline]
 __lru_add_drain_all+0x21d/0x420 mm/swap.c:894
 lru_add_drain_all+0x10/0x20 mm/swap.c:910
 invalidate_bdev+0x54/0x80 block/bdev.c:95
 ext4_put_super+0x51b/0x7e0 fs/ext4/super.c:1361
 generic_shutdown_super+0xde/0x210 fs/super.c:641
 kill_block_super+0x2a/0x70 fs/super.c:1675
 ext4_kill_sb+0x44/0x80 fs/ext4/super.c:7319
 deactivate_locked_super+0x7d/0x1c0 fs/super.c:472
 deactivate_super+0x9f/0xb0 fs/super.c:505
 cleanup_mnt+0x272/0x2e0 fs/namespace.c:1267
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1274
 task_work_run+0x13a/0x1a0 kernel/task_work.c:180
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:114 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0xbe/0x130 kernel/entry/common.c:218
 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00 -> 0x1f

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 19155 Comm: syz-executor.1 Not tainted 6.9.0-syzkaller-09429-g61307b7be41a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
==================================================================
EXT4-fs (loop1): unmounting filesystem 00000000-0000-0000-0000-000000000000.

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/19 21:10 upstream 61307b7be41a c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __lru_add_drain_all / folio_activate
2024/04/24 22:05 upstream e88c4cfcb7b8 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __lru_add_drain_all / folio_activate
* Struck through repros no longer work on HEAD.