Page MenuHomeFreeBSD

vm_page: Clear VM_ALLOC_NOCREAT in vm_page_grab_pflags()
ClosedPublic

Authored by markj on Fri, Aug 1, 11:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Aug 7, 2:57 PM
Unknown Object (File)
Wed, Aug 6, 11:32 AM
Unknown Object (File)
Tue, Aug 5, 9:04 AM
Unknown Object (File)
Tue, Aug 5, 5:39 AM
Unknown Object (File)
Tue, Aug 5, 5:30 AM
Unknown Object (File)
Tue, Aug 5, 4:50 AM
Unknown Object (File)
Mon, Aug 4, 2:42 PM
Unknown Object (File)
Mon, Aug 4, 4:56 AM
Subscribers

Details

Summary

Otherwise vm_page_grab_zero_partial() and vm_page_grab_pages() can pass
it to vm_page_alloc_*(), which results in an assertion failure since
that flag is meaningless when allocating a page:

panic: invalid request 0x8400
cpuid = 0
time = 1754074745
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x49/frame 0xfffffe00542859c0
vpanic() at vpanic+0x1ea/frame 0xfffffe0054285b00
panic() at panic+0x43/frame 0xfffffe0054285b60
vm_page_alloc_domain_iter() at vm_page_alloc_domain_iter+0x720/frame 0xfffffe0054285be0
vm_page_grab_zero_partial() at vm_page_grab_zero_partial+0x1d4/frame 0xfffffe0054285c90
shm_fspacectl() at shm_fspacectl+0x1cd/frame 0xfffffe0054285d30
kern_fspacectl() at kern_fspacectl+0x49f/frame 0xfffffe0054285db0
sys_fspacectl() at sys_fspacectl+0x5b/frame 0xfffffe0054285e00
amd64_syscall() at amd64_syscall+0x29c/frame 0xfffffe0054285f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0054285f30

Reported by: syzkaller

Diff Detail

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

Event Timeline

markj requested review of this revision.Fri, Aug 1, 11:38 PM
kib accepted this revision.EditedSat, Aug 2, 1:07 AM

May be its time to switch from &~() to &, i.e. allow explicitly listed flags.

This revision is now accepted and ready to land.Sat, Aug 2, 1:07 AM
In D51692#1180692, @kib wrote:

May be its time to switch from &~() to &, i.e. allow explicitly listed flags.

Most of the VM_ALLOC_* flags should be passed through, so the length of the list wouldn't change much. I also like that we explicitly clear the NOWAIT, WAITOK, WAITFAIL flags here.