Page MenuHomeFreeBSD

amd64 pmap: Release PTP reference on leaf ptpage allocation failure
ClosedPublic

Authored by bnovkov on Jun 13 2024, 4:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 7, 3:09 AM
Unknown Object (File)
Sat, Oct 4, 12:04 PM
Unknown Object (File)
Sat, Sep 20, 8:42 AM
Unknown Object (File)
Fri, Sep 19, 5:06 AM
Unknown Object (File)
Aug 20 2025, 9:07 PM
Unknown Object (File)
Aug 10 2025, 12:09 AM
Unknown Object (File)
Jul 26 2025, 5:55 AM
Unknown Object (File)
Jul 7 2025, 1:28 AM
Subscribers

Details

Summary

aa3bcaa fixed an edge case invloving mlock() and superpage creation
by creating and inserting a leaf pagetable page for mlock'd superpages.
However, the code does not properly release the reference to the
pagetable page in the error handling path.
This commit fixes the issue by adding calls to 'pmap_abort_ptp'
in the error handling path.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jun 13 2024, 7:35 PM
sys/amd64/amd64/pmap.c
7599

There are some code paths in this function which handle pdpg == NULL, but I don't think that's possible.

sys/amd64/amd64/pmap.c
7599

Yes, because pmap != kernel_pmap.