]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix a page table pages leak after LA57.
authorKonstantin Belousov <kib@FreeBSD.org>
Wed, 2 Sep 2020 15:55:16 +0000 (15:55 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Wed, 2 Sep 2020 15:55:16 +0000 (15:55 +0000)
commit8f8838c05911b47eff6043ac331e2b4c58cedb48
treeddedeb2bcf9c3ffba458757c55dffea6b084118d
parent3fcf9dc4b78133b284d37fc2db6228ef80766b1b
Fix a page table pages leak after LA57.

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 in _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
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D26293
sys/amd64/amd64/pmap.c