Page MenuHomeFreeBSD

vm_map: fix iterator jump size
ClosedPublic

Authored by dougm on Apr 23 2025, 8:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 4, 8:29 AM
Unknown Object (File)
Thu, Sep 25, 7:12 PM
Unknown Object (File)
Tue, Sep 23, 10:03 PM
Unknown Object (File)
Mon, Sep 22, 10:32 PM
Unknown Object (File)
Mon, Sep 22, 5:06 PM
Unknown Object (File)
Mon, Sep 22, 1:08 PM
Unknown Object (File)
Sat, Sep 20, 12:15 AM
Unknown Object (File)
Sep 16 2025, 5:11 PM
Subscribers

Details

Summary

The index value in the loop in vm_map_pmap_enter jumps by 1, or some superpage size, in each iteration. Jump by the superpage size only when the entire superpage is being mapped.

Fixes: b3d89a0cde94 ("vm_map: use page iterators in pmap_enter")
Reported-by: syzbot+1cc9ede76727d2ea2e8d@syzkaller.appspotmail.com

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.Apr 23 2025, 8:42 PM
dougm created this revision.
This revision is now accepted and ready to land.Apr 24 2025, 6:57 AM
sys/vm/vm_map.c
2736–2741

On second thought, ...

dougm edited the summary of this revision. (Show Details)

Use 'jump' variable, as recommended.

This revision now requires review to proceed.Apr 24 2025, 7:27 AM
This revision is now accepted and ready to land.Apr 24 2025, 7:52 AM

I ran the syzkaller reproducer for an hour with D49987.154201.patch added. I added a further 4 hours of random test cases.
I did not observe any issues.

This revision was automatically updated to reflect the committed changes.