HomeFreeBSD

vm_phys: Make sure that vm_phys_enq_chunk() stays in bounds

Description

vm_phys: Make sure that vm_phys_enq_chunk() stays in bounds

vm_phys_enq_chunk() inserts a run of pages into the buddy queues. When
lazy initialization is enabled, only the first page of each run is
initialized; vm_phys_enq_chunk() thus initializes the page following the
just-inserted run.

This fails to account for the possibility that the page following the
run doesn't belong to the segment. Handle that in vm_phys_enq_chunk().

Reported by: KASAN
Reported by: syzbot+1097ef4cee8dfb240e31@syzkaller.appspotmail.com
Fixes: b16b4c22d2d1 ("vm_page: Implement lazy page initialization")

Details

Provenance
markjAuthored on Fri, Jun 14, 2:45 PM
Parents
rG80b42329248a: nvme: Fix panic on detach after ce75bfcac9cfe
Branches
Unknown
Tags
Unknown