Page MenuHomeFreeBSD

i386: Use atomic 64bit load to read PDE value from PAE pagetables in pmap_kextract().
ClosedPublic

Authored by kib on Jan 2 2019, 1:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 11, 6:19 PM
Unknown Object (File)
Wed, May 7, 7:57 PM
Unknown Object (File)
Apr 24 2025, 4:27 AM
Unknown Object (File)
Feb 12 2025, 10:07 PM
Unknown Object (File)
Feb 11 2025, 7:46 PM
Unknown Object (File)
Feb 5 2025, 11:39 PM
Unknown Object (File)
Jan 24 2025, 10:30 AM
Unknown Object (File)
Jan 22 2025, 7:08 AM
Subscribers

Details

Summary

pmap_kextract() can race with promotion/demotion on the kernel page table, in which case current non-atomic 64bit read would see torn value, breaking pmap_kextract(). pmap_kextract() would correctly handle either promoted or demoted PDE, but not the mix where one word is from a different state.

It requires PAE and > 4G memory to reproduce. We observed this in real loads, both for intensive use of malloc()/free() where vtoslab() returned invalid pointer to the slab, and with the use of busdma_bounce, where incorrect page was bounced.

In collaboration with: pho

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable