Re: [PATCH v4] /dev/mem: Revoke mappings when a driver claims the region

2020-05-21 Thread Kees Cook
On Thu, May 21, 2020 at 02:06:17PM -0700, Dan Williams wrote: > The typical usage of unmap_mapping_range() is part of > truncate_pagecache() to punch a hole in a file, but in this case the > implementation is only doing the "first half" of a hole punch. Namely it > is just evacuating current

[PATCH v4] /dev/mem: Revoke mappings when a driver claims the region

2020-05-21 Thread Dan Williams
Close the hole of holding a mapping over kernel driver takeover event of a given address range. Commit 90a545e98126 ("restrict /dev/mem to idle io memory ranges") introduced CONFIG_IO_STRICT_DEVMEM with the goal of protecting the kernel against scenarios where a /dev/mem user tramples memory that