Re: [PATCH v2 2/3] devmem: Block mmap access when read/write access is restricted
From: Dave Hansen
Date: Fri Apr 11 2025 - 11:38:36 EST
On 4/10/25 21:59, Dan Williams wrote:
>> I don't think we can just fail the mmap. 🙁
> For the TVM case the havoc of failing mmap for DMI info is smaller and
> the recommended fallback for /dev/mem being in accessible is
> /sys/firmware/dmi/tables. So I feel ok making TVMs take the modern
> replacement path which is what they would need to do anyway in the
> lockdown_kernel case. Tom, Dave, what do you think?
Yeah, doing the same as lockdown should be fine.
The other alternative to failing all mmap()s is to allow mmap(PROT_READ)
to succeed and then just map the zero page.