Page MenuHomeFreeBSD

Fix a page table pages leak after LA57.
ClosedPublic

Authored by kib on Sep 2 2020, 9:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 10:53 PM
Unknown Object (File)
Sep 26 2023, 9:25 AM
Unknown Object (File)
Sep 26 2023, 9:25 AM
Unknown Object (File)
Sep 26 2023, 9:24 AM
Unknown Object (File)
Sep 7 2023, 11:28 AM
Unknown Object (File)
Aug 28 2023, 8:07 PM
Unknown Object (File)
Jan 6 2023, 2:38 AM
Subscribers

Details

Summary

If the call to _pmap_allocpte() is not sleepable, it is possible that allocation of PML4 or PDP page is successful but either PDP or PD page is not. Restructured code _pmap_allocpte() leaves zero-referenced page in the paging structure.

Handle it by checking refcount of the page one level above failed alloc and free that page if its reference count is zero.

Reported and tested by: pho

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Sep 2 2020, 9:23 AM
markj added inline comments.
sys/amd64/amd64/pmap.c
4106 ↗(On Diff #76531)

I would call it _unref.

This revision is now accepted and ready to land.Sep 2 2020, 2:40 PM
This revision was automatically updated to reflect the committed changes.