]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix a page table pages leak after LA57.
authorkib <kib@FreeBSD.org>
Wed, 2 Sep 2020 15:55:16 +0000 (15:55 +0000)
committerkib <kib@FreeBSD.org>
Wed, 2 Sep 2020 15:55:16 +0000 (15:55 +0000)
commit607b961a89b6b2dd36ceb23a9f882c4a0c232d5a
treeddedeb2bcf9c3ffba458757c55dffea6b084118d
parenta879b8fc67d940cc679676ed101de66e3bc3c5ff
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