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)
Wed, Apr 15, 11:24 AM
Unknown Object (File)
Mon, Apr 13, 12:05 PM
Unknown Object (File)
Sat, Apr 11, 9:56 AM
Unknown Object (File)
Fri, Apr 10, 12:03 PM
Unknown Object (File)
Mon, Apr 6, 2:42 PM
Unknown Object (File)
Sat, Apr 4, 10:58 AM
Unknown Object (File)
Fri, Mar 27, 8:41 AM
Unknown Object (File)
Wed, Mar 25, 7:45 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.