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
F153219794: D18714.id52560.diff
Sun, Apr 19, 9:28 PM
Unknown Object (File)
Wed, Apr 15, 12:44 AM
Unknown Object (File)
Mon, Apr 6, 8:33 AM
Unknown Object (File)
Sun, Apr 5, 7:51 AM
Unknown Object (File)
Sun, Apr 5, 6:52 AM
Unknown Object (File)
Sat, Apr 4, 1:14 PM
Unknown Object (File)
Sun, Mar 22, 9:44 PM
Unknown Object (File)
Mar 15 2026, 8:04 PM
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