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)
Jul 14 2025, 2:59 PM
Unknown Object (File)
Jul 12 2025, 2:17 PM
Unknown Object (File)
Jul 8 2025, 10:56 AM
Unknown Object (File)
Jul 6 2025, 12:20 AM
Unknown Object (File)
Jul 5 2025, 7:12 AM
Unknown Object (File)
Jun 30 2025, 9:38 PM
Unknown Object (File)
Jun 15 2025, 10:37 PM
Unknown Object (File)
Jun 15 2025, 2:51 PM
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.