syzbot


ID Workflow Result Correct Bug Created Started Finished Revision Error
53c8b470-8959-4dc4-90ab-c724e0cf98b4 repro KCSAN: data-race in copy_mm / dup_mmap (3) 2026/03/07 18:34 2026/03/07 18:34 2026/03/07 18:41 31e9c887f7dc24e04b3ca70d0d54fc34141844b0


ReproOpts:
{"procs": 6, "repeat": true, "threaded": true, "collide": true}


ReproSyz:
mmap(&(0x7f0000000000/0x10000)=nil, 0x10000, 0x3, 0x8032, -1, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)


SyzkallerCommit:
31e9c887f7dc24e04b3ca70d0d54fc34141844b0

Crash report:
==================================================================
BUG: KCSAN: data-race in copy_mm / dup_mmap

read-write to 0xffff88810476edd0 of 4 bytes by task 14629 on cpu 0:
 do_raw_write_seqcount_begin include/linux/seqlock.h:431 [inline]
 mm_lock_seqcount_begin include/linux/mmap_lock.h:88 [inline]
 mmap_write_lock_killable include/linux/mmap_lock.h:355 [inline]
 dup_mmap+0xed/0xf00 mm/mmap.c:1726
 dup_mm kernel/fork.c:1529 [inline]
 copy_mm+0x119/0x370 kernel/fork.c:1581
 copy_process+0xcbd/0x1f10 kernel/fork.c:2221
 kernel_clone+0x16b/0x5b0 kernel/fork.c:2651
 __do_sys_clone kernel/fork.c:2792 [inline]
 __se_sys_clone kernel/fork.c:2776 [inline]
 __x64_sys_clone+0x143/0x180 kernel/fork.c:2776
 x64_sys_call+0x12d0/0x3000 arch/x86/include/generated/asm/syscalls_64.h:57
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xc0/0x2a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88810476ec00 of 1664 bytes by task 14628 on cpu 1:
 dup_mm kernel/fork.c:1523 [inline]
 copy_mm+0xe1/0x370 kernel/fork.c:1581
 copy_process+0xcbd/0x1f10 kernel/fork.c:2221
 kernel_clone+0x16b/0x5b0 kernel/fork.c:2651
 __do_sys_clone kernel/fork.c:2792 [inline]
 __se_sys_clone kernel/fork.c:2776 [inline]
 __x64_sys_clone+0x143/0x180 kernel/fork.c:2776
 x64_sys_call+0x12d0/0x3000 arch/x86/include/generated/asm/syscalls_64.h:57
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xc0/0x2a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 14628 Comm: syz.4.3331 Tainted: G        W           syzkaller #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
==================================================================

Trajectory:
Seq Timestamp Type Name Duration
0/0 2026/03/07 18:34 flow repro
6m Results:
map[ReproOpts:{"procs": 6, "repeat": true, "threaded": true, "collide": true} ReproSyz:mmap(&(0x7f0000000000/0x10000)=nil, 0x10000, 0x3, 0x8032, -1, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0) SyzkallerCommit:31e9c887f7dc24e04b3ca70d0d54fc34141844b0]

1/1 2026/03/07 18:34 action provide-var
0m Results:
map[DescriptionFiles:[acpi_thermal_rel.txt aio.txt auto.txt binfmt.txt bpf.txt bpf_prog.txt bpf_trace.txt cgroup.txt damon.txt dev_ashmem.txt dev_bifrost.txt dev_binder.txt dev_binderfs.txt dev_block.txt dev_bsg.txt dev_bus_usb.txt dev_camx.txt dev_cdrom.txt dev_cec.txt dev_char_usb.txt dev_comedi.txt dev_dma_heap.txt dev_dri.txt dev_dsp.txt dev_dvb_demux.txt dev_dvb_dvr.txt dev_dvb_frontend.txt dev_fb.txt dev_floppy.txt dev_hidraw.txt dev_i2c.txt dev_i915.txt dev_img_rogue.txt dev_infiniband_rdma.txt dev_infiniband_rdma_cm.txt dev_input.txt dev_iommu.txt dev_kvm.txt dev_kvm_amd64.txt dev_kvm_arm64.txt dev_kvm_extra.txt dev_kvm_riscv64.txt dev_loop.txt dev_mali.txt dev_media.txt dev_msm.txt dev_msr.txt dev_nbd.txt dev_net_tun.txt dev_panthor.txt dev_ppp.txt dev_ptmx.txt dev_ptp.txt dev_qat_adf_ctl.txt dev_qrtr_tun.txt dev_random.txt dev_rfkill.txt dev_rtc.txt dev_sequencer.txt dev_sg.txt dev_snapshot.txt dev_snd_control.txt dev_snd_hw.txt dev_snd_midi.txt dev_snd_pcm.txt dev_snd_seq.txt dev_snd_timer.txt dev_sr.txt dev_sw_sync.txt dev_tlk_device.txt dev_trusty.txt dev_udmabuf.txt dev_uhid.txt dev_uinput.txt dev_usb_hiddev.txt dev_usbmon.txt dev_userio.txt dev_vfio.txt dev_vga_arbiter.txt dev_vhci.txt dev_video4linux.txt dev_video4linux_vim2m.txt dev_virtual_nci.txt dev_vtpm.txt fanotify.txt filesystem.txt fs_9p.txt fs_fuse.txt fs_incfs.txt fs_ioctl.txt fs_ioctl_autofs.txt fs_ioctl_btrfs.txt fs_ioctl_ext4.txt fs_ioctl_f2fs.txt fs_ioctl_fat.txt fs_ioctl_fscrypt.txt fs_ioctl_fsverity.txt fs_ioctl_xfs.txt futex.txt hafnium.txt inotify.txt io_uring.txt ipc.txt key.txt kfuzztest.txt l2cap.txt landlock.txt lsm.txt namespaces.txt net_80211.txt netfilter.txt netfilter_arp.txt netfilter_bridge.txt netfilter_ipv4.txt netfilter_ipv6.txt netfilter_ipvs.txt netfilter_targets.txt pagemap_ioctl.txt perf.txt prctl.txt quotactl.txt seccomp.txt security_apparmor.txt security_selinux.txt security_smack.txt socket.txt socket_alg.txt socket_ax25.txt socket_bluetooth.txt socket_caif.txt socket_can.txt socket_ieee802154.txt socket_inet.txt socket_inet6.txt socket_inet_dccp.txt socket_inet_icmp.txt socket_inet_igmp.txt socket_inet_l2tp.txt socket_inet_sctp.txt socket_inet_tcp.txt socket_inet_udp.txt socket_ip_tunnel.txt socket_isdn.txt socket_kcm.txt socket_key.txt socket_llc.txt socket_netlink.txt socket_netlink_audit.txt socket_netlink_crypto.txt socket_netlink_generic.txt socket_netlink_generic_80211.txt socket_netlink_generic_batadv.txt socket_netlink_generic_devlink.txt socket_netlink_generic_ethtool.txt socket_netlink_generic_fou.txt socket_netlink_generic_gtp.txt socket_netlink_generic_mptcp.txt socket_netlink_generic_net_dm.txt socket_netlink_generic_netlabel.txt socket_netlink_generic_nfc.txt socket_netlink_generic_seg6.txt socket_netlink_generic_smc.txt socket_netlink_generic_team.txt socket_netlink_generic_wireguard.txt socket_netlink_netfilter.txt socket_netlink_netfilter_acct.txt socket_netlink_netfilter_conntrack.txt socket_netlink_netfilter_conntrack_exp.txt socket_netlink_netfilter_conntrack_helper.txt socket_netlink_netfilter_ipset.txt socket_netlink_netfilter_log.txt socket_netlink_netfilter_nft_compat.txt socket_netlink_netfilter_nftables.txt socket_netlink_netfilter_osf.txt socket_netlink_netfilter_queue.txt socket_netlink_netfilter_timeout.txt socket_netlink_rdma.txt socket_netlink_route.txt socket_netlink_route_sched.txt socket_netlink_route_sched_retired.txt socket_netlink_sock_diag.txt socket_netlink_xfrm.txt socket_netrom.txt socket_nfc.txt socket_nvme_of_tcp.txt socket_packet.txt socket_phonet.txt socket_pppox.txt socket_qipcrtr.txt socket_rds.txt socket_rose.txt socket_rxrpc.txt socket_tipc.txt socket_tipc_netlink.txt socket_unix.txt socket_vnet.txt socket_x25.txt socket_xdp.txt sys.txt uffd.txt usbip.txt vmw_vmci.txt vnet.txt vnet_mptcp.txt vusb.txt watch_queue.txt xattr.txt] SyzkallerCommit:31e9c887f7dc24e04b3ca70d0d54fc34141844b0]

2/1 2026/03/07 18:34 action kernel-checkouter
0m Results:
map[KernelSrc:/usr/local/google/home/dvyukov/syzkaller/agent/workdir/cache/src/6bf99a46fe07931230f0a455cc816adb64b10fd9]

3/1 2026/03/07 18:35 action kernel-builder
4m Results:
map[KernelObj:/usr/local/google/home/dvyukov/syzkaller/agent/workdir/cache/build/a73b7d1e787dc98e60639807307595fccfcc422e]

4/1 2026/03/07 18:39 agent crash-repro-finder
1m Model:
gemini-3-pro-preview

Results:
map[ReproOpts:{"procs": 6, "repeat": true, "threaded": true, "collide": true}]

Instruction:
You are an expert in linux kernel fuzzing. Your goal is to write a syzkaller program to trigger a specific bug.
Print only the syz program that could be executed directly, without backticks.




Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Bug Title: KCSAN: data-race in copy_mm / dup_mmap

Original Crash Report:
==================================================================
BUG: KCSAN: data-race in copy_mm / dup_mmap

read-write to 0xffff88810476edd0 of 4 bytes by task 14629 on cpu 0:
 do_raw_write_seqcount_begin include/linux/seqlock.h:431 [inline]
 mm_lock_seqcount_begin include/linux/mmap_lock.h:88 [inline]
 mmap_write_lock_killable include/linux/mmap_lock.h:355 [inline]
 dup_mmap+0xed/0xf00 mm/mmap.c:1726
 dup_mm kernel/fork.c:1529 [inline]
 copy_mm+0x119/0x370 kernel/fork.c:1581
 copy_process+0xcbd/0x1f10 kernel/fork.c:2221
 kernel_clone+0x16b/0x5b0 kernel/fork.c:2651
 __do_sys_clone kernel/fork.c:2792 [inline]
 __se_sys_clone kernel/fork.c:2776 [inline]
 __x64_sys_clone+0x143/0x180 kernel/fork.c:2776
 x64_sys_call+0x12d0/0x3000 arch/x86/include/generated/asm/syscalls_64.h:57
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xc0/0x2a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88810476ec00 of 1664 bytes by task 14628 on cpu 1:
 dup_mm kernel/fork.c:1523 [inline]
 copy_mm+0xe1/0x370 kernel/fork.c:1581
 copy_process+0xcbd/0x1f10 kernel/fork.c:2221
 kernel_clone+0x16b/0x5b0 kernel/fork.c:2651
 __do_sys_clone kernel/fork.c:2792 [inline]
 __se_sys_clone kernel/fork.c:2776 [inline]
 __x64_sys_clone+0x143/0x180 kernel/fork.c:2776
 x64_sys_call+0x12d0/0x3000 arch/x86/include/generated/asm/syscalls_64.h:57
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xc0/0x2a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 14628 Comm: syz.4.3331 Tainted: G        W           syzkaller #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
==================================================================


The list of existing description files:
acpi_thermal_rel.txt
aio.txt
auto.txt
binfmt.txt
bpf.txt
bpf_prog.txt
bpf_trace.txt
cgroup.txt
damon.txt
dev_ashmem.txt
dev_bifrost.txt
dev_binder.txt
dev_binderfs.txt
dev_block.txt
dev_bsg.txt
dev_bus_usb.txt
dev_camx.txt
dev_cdrom.txt
dev_cec.txt
dev_char_usb.txt
dev_comedi.txt
dev_dma_heap.txt
dev_dri.txt
dev_dsp.txt
dev_dvb_demux.txt
dev_dvb_dvr.txt
dev_dvb_frontend.txt
dev_fb.txt
dev_floppy.txt
dev_hidraw.txt
dev_i2c.txt
dev_i915.txt
dev_img_rogue.txt
dev_infiniband_rdma.txt
dev_infiniband_rdma_cm.txt
dev_input.txt
dev_iommu.txt
dev_kvm.txt
dev_kvm_amd64.txt
dev_kvm_arm64.txt
dev_kvm_extra.txt
dev_kvm_riscv64.txt
dev_loop.txt
dev_mali.txt
dev_media.txt
dev_msm.txt
dev_msr.txt
dev_nbd.txt
dev_net_tun.txt
dev_panthor.txt
dev_ppp.txt
dev_ptmx.txt
dev_ptp.txt
dev_qat_adf_ctl.txt
dev_qrtr_tun.txt
dev_random.txt
dev_rfkill.txt
dev_rtc.txt
dev_sequencer.txt
dev_sg.txt
dev_snapshot.txt
dev_snd_control.txt
dev_snd_hw.txt
dev_snd_midi.txt
dev_snd_pcm.txt
dev_snd_seq.txt
dev_snd_timer.txt
dev_sr.txt
dev_sw_sync.txt
dev_tlk_device.txt
dev_trusty.txt
dev_udmabuf.txt
dev_uhid.txt
dev_uinput.txt
dev_usb_hiddev.txt
dev_usbmon.txt
dev_userio.txt
dev_vfio.txt
dev_vga_arbiter.txt
dev_vhci.txt
dev_video4linux.txt
dev_video4linux_vim2m.txt
dev_virtual_nci.txt
dev_vtpm.txt
fanotify.txt
filesystem.txt
fs_9p.txt
fs_fuse.txt
fs_incfs.txt
fs_ioctl.txt
fs_ioctl_autofs.txt
fs_ioctl_btrfs.txt
fs_ioctl_ext4.txt
fs_ioctl_f2fs.txt
fs_ioctl_fat.txt
fs_ioctl_fscrypt.txt
fs_ioctl_fsverity.txt
fs_ioctl_xfs.txt
futex.txt
hafnium.txt
inotify.txt
io_uring.txt
ipc.txt
key.txt
kfuzztest.txt
l2cap.txt
landlock.txt
lsm.txt
namespaces.txt
net_80211.txt
netfilter.txt
netfilter_arp.txt
netfilter_bridge.txt
netfilter_ipv4.txt
netfilter_ipv6.txt
netfilter_ipvs.txt
netfilter_targets.txt
pagemap_ioctl.txt
perf.txt
prctl.txt
quotactl.txt
seccomp.txt
security_apparmor.txt
security_selinux.txt
security_smack.txt
socket.txt
socket_alg.txt
socket_ax25.txt
socket_bluetooth.txt
socket_caif.txt
socket_can.txt
socket_ieee802154.txt
socket_inet.txt
socket_inet6.txt
socket_inet_dccp.txt
socket_inet_icmp.txt
socket_inet_igmp.txt
socket_inet_l2tp.txt
socket_inet_sctp.txt
socket_inet_tcp.txt
socket_inet_udp.txt
socket_ip_tunnel.txt
socket_isdn.txt
socket_kcm.txt
socket_key.txt
socket_llc.txt
socket_netlink.txt
socket_netlink_audit.txt
socket_netlink_crypto.txt
socket_netlink_generic.txt
socket_netlink_generic_80211.txt
socket_netlink_generic_batadv.txt
socket_netlink_generic_devlink.txt
socket_netlink_generic_ethtool.txt
socket_netlink_generic_fou.txt
socket_netlink_generic_gtp.txt
socket_netlink_generic_mptcp.txt
socket_netlink_generic_net_dm.txt
socket_netlink_generic_netlabel.txt
socket_netlink_generic_nfc.txt
socket_netlink_generic_seg6.txt
socket_netlink_generic_smc.txt
socket_netlink_generic_team.txt
socket_netlink_generic_wireguard.txt
socket_netlink_netfilter.txt
socket_netlink_netfilter_acct.txt
socket_netlink_netfilter_conntrack.txt
socket_netlink_netfilter_conntrack_exp.txt
socket_netlink_netfilter_conntrack_helper.txt
socket_netlink_netfilter_ipset.txt
socket_netlink_netfilter_log.txt
socket_netlink_netfilter_nft_compat.txt
socket_netlink_netfilter_nftables.txt
socket_netlink_netfilter_osf.txt
socket_netlink_netfilter_queue.txt
socket_netlink_netfilter_timeout.txt
socket_netlink_rdma.txt
socket_netlink_route.txt
socket_netlink_route_sched.txt
socket_netlink_route_sched_retired.txt
socket_netlink_sock_diag.txt
socket_netlink_xfrm.txt
socket_netrom.txt
socket_nfc.txt
socket_nvme_of_tcp.txt
socket_packet.txt
socket_phonet.txt
socket_pppox.txt
socket_qipcrtr.txt
socket_rds.txt
socket_rose.txt
socket_rxrpc.txt
socket_tipc.txt
socket_tipc_netlink.txt
socket_unix.txt
socket_vnet.txt
socket_x25.txt
socket_xdp.txt
sys.txt
uffd.txt
usbip.txt
vmw_vmci.txt
vnet.txt
vnet_mptcp.txt
vusb.txt
watch_queue.txt
xattr.txt


Reply:
mmap(&(0x7f0000000000/0x10000)=nil, 0x10000, 0x3, 0x8032, -1, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)

5/2 2026/03/07 18:39 llm crash-repro-finder
1m Model:
gemini-3-pro-preview

Tokens:
							input: 2771
							output: 39
							thoughts: 9300
						

Thoughts:
**Analysis and Reproduction Strategy for KCSAN Data Race in `copy_mm`/`dup_mmap`**

Okay, so I've got this KCSAN data race report, and I'm on it. The crash is in the `copy_mm` and `dup_mmap` functions, specifically involving a read/write conflict on something inside the `mm_struct`. The write side comes from a `fork` or `clone` call, where `dup_mmap` acquires a write lock on the `mm->mmap_lock` (or rather its associated seqcount), and a read happens concurrently during the `memcpy` of the mm_struct within `dup_mm`.

From my analysis of the code in `kernel/fork.c`, `dup_mm` copies the `mm_struct` using `memcpy` *before* `dup_mmap` gets called. `dup_mmap` then iterates through the Virtual Memory Areas (VMAs) and acquires a write lock on the *old* mm (the source) to safely manage those VMAs, modifying `mm->mmap_lock` as it does so. The race happens because `memcpy` can be active at the same time as `dup_mmap` is writing the `mm->mmap_lock` seqcount. The specific read/write offsets in the crash report (`0xffff88810476ec00` vs. `0xffff88810476edd0`) suggest they are clashing on different fields within the mm_struct. This read-write happens on the same structure due to the clone.

The tricky part here is that the initial copy of `mmap_lock` in `memcpy` is immediately overwritten with an initialized value later in `dup_mm`. This might mean the race isn't *harmful* from a functional perspective because `mm->mmap_lock` is re-initialized, but KCSAN flags it because it's still technically a data race due to concurrent reads and writes.

My plan is to reproduce this using syzkaller. I need to get two threads running in the same process to call `fork()` (or `clone` without `CLONE_VM`) at the same time. The threads must share an address space which means they must use `CLONE_VM`. Syzkaller's `syz_executor` creates threads automatically when running syscalls with `-threaded`. I'll focus on getting the right sequence of calls: create the threads to fork.

The syzkaller program I'm crafting has to make two threads trigger `clone` (without `CLONE_VM`). I need `threaded=true` (which causes syscalls in a program to be executed by multiple threads). I also need to make sure the VMAs are not empty in the source mm. I'll include a `mmap` call before forking to populate those VMAs. I'll add the `MAP_POPULATE` flag to `mmap` to force the page tables to be populated and slow down `dup_mmap`, which might make the race more likely (by making the lock last longer). I will set `procs` to 6 just to increase the load.

To maximize the chance of a race, I will use `collide: true`.

My resulting syzkaller program consists of:

```
mmap(&(0x7f0000000000/0x10000)=nil, 0x10000, 0x3, 0x8032, -1, 0)
clone(0x11, 0, 0, 0, 0, 0)
clone(0x11, 0, 0, 0, 0, 0)
```

The repro options are `{"procs": 6, "repeat": true, "threaded": true, "collide": true}`.



6/2 2026/03/07 18:41 tool set-results
0m Args:
map[ReproOpts:{"procs": 6, "repeat": true, "threaded": true, "collide": true}]

Results:
map[ReproOpts:{"procs": 6, "repeat": true, "threaded": true, "collide": true}]

7/2 2026/03/07 18:41 llm crash-repro-finder
0m Model:
gemini-3-pro-preview

Tokens:
							input: 12999
							output: 148
							thoughts: 0
						

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)