syzbot


KCSAN: data-race in munlock_folio / need_mlock_drain (3)

Status: auto-obsoleted due to no activity on 2024/02/18 23:01
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+aeb5366e251035c94082@syzkaller.appspotmail.com
First crash: 215d, last: 186d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in munlock_folio / need_mlock_drain mm 1 444d 444d 0/27 auto-obsoleted due to no activity on 2023/06/05 22:24
upstream KCSAN: data-race in munlock_folio / need_mlock_drain (2) mm 1 290d 290d 0/27 auto-obsoleted due to no activity on 2023/11/07 10:03
upstream KCSAN: data-race in munlock_folio / need_mlock_drain (5) mm 6 7d03h 47d 0/27 moderation: reported on 2024/06/02 17:40
upstream KCSAN: data-race in munlock_folio / need_mlock_drain (4) mm 1 84d 84d 0/27 auto-obsoleted due to no activity on 2024/05/31 11:19

Sample crash report:
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
==================================================================
BUG: KCSAN: data-race in munlock_folio / need_mlock_drain

read-write to 0xffff888237c2a510 of 1 bytes by task 20759 on cpu 0:
 folio_batch_add include/linux/pagevec.h:74 [inline]
 munlock_folio+0x3c/0x120 mm/mlock.c:302
 munlock_vma_folio mm/internal.h:687 [inline]
 __folio_remove_rmap mm/rmap.c:1573 [inline]
 folio_remove_rmap_ptes+0x175/0x180 mm/rmap.c:1590
 zap_pte_range mm/memory.c:1478 [inline]
 zap_pmd_range mm/memory.c:1597 [inline]
 zap_pud_range mm/memory.c:1626 [inline]
 zap_p4d_range mm/memory.c:1647 [inline]
 unmap_page_range+0xe0d/0x1e60 mm/memory.c:1668
 unmap_single_vma+0x142/0x1d0 mm/memory.c:1714
 unmap_vmas+0x18d/0x2b0 mm/memory.c:1758
 exit_mmap+0x1a2/0x6e0 mm/mmap.c:3277
 __mmput+0x28/0x1c0 kernel/fork.c:1343
 mmput+0x4c/0x60 kernel/fork.c:1365
 exit_mm+0xe3/0x180 kernel/exit.c:569
 do_exit+0x585/0x16d0 kernel/exit.c:858
 do_group_exit+0x101/0x150 kernel/exit.c:1020
 get_signal+0xf4e/0x10a0 kernel/signal.c:2893
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop kernel/entry/common.c:105 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline]
 syscall_exit_to_user_mode+0x57/0x130 kernel/entry/common.c:212
 do_syscall_64+0x65/0x120 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff888237c2a510 of 1 bytes by task 3085 on cpu 1:
 folio_batch_count include/linux/pagevec.h:53 [inline]
 need_mlock_drain+0x30/0x50 mm/mlock.c:236
 cpu_needs_drain mm/swap.c:801 [inline]
 __lru_add_drain_all+0x240/0x420 mm/swap.c:889
 lru_add_drain_all+0x10/0x20 mm/swap.c:905
 invalidate_bdev+0x54/0x70 block/bdev.c:89
 ext4_put_super+0x51b/0x7e0 fs/ext4/super.c:1361
 generic_shutdown_super+0xdb/0x210 fs/super.c:646
 kill_block_super+0x2a/0x60 fs/super.c:1680
 ext4_kill_sb+0x44/0x80 fs/ext4/super.c:7319
 deactivate_locked_super+0x7a/0x1c0 fs/super.c:477
 deactivate_super+0x9b/0xb0 fs/super.c:510
 cleanup_mnt+0x272/0x2e0 fs/namespace.c:1267
 __cleanup_mnt+0x19/0x20 fs/namespace.c:1274
 task_work_run+0x135/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:108 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:201 [inline]
 syscall_exit_to_user_mode+0xbc/0x130 kernel/entry/common.c:212
 do_syscall_64+0x65/0x120 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x00 -> 0x0a

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 3085 Comm: syz-executor.2 Not tainted 6.7.0-syzkaller-09928-g052d534373b7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
==================================================================
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs (loop2): 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/01/14 23:01 upstream 052d534373b7 551587c1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in munlock_folio / need_mlock_drain
2023/12/16 23:40 upstream c8e97fc6b4c0 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in munlock_folio / need_mlock_drain
* Struck through repros no longer work on HEAD.