Thread (10 messages) 10 messages, 2 authors, 2021-08-12

[PATCH v1 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem

flat view
STALE1903d SUPERSEDED

From: David Hildenbrand <hidden>
Date: 2021-08-11 20:36:30
Also in: linux-mm, lkml
Subsystem: char and misc drivers, library code, the rest, virtio core, virtio mem driver · Maintainers: Arnd Bergmann, Greg Kroah-Hartman, Andrew Morton, Linus Torvalds, "Michael S. Tsirkin", Jason Wang, Eugenio Pérez, David Hildenbrand

Status: Superseded by v5 (posted 2021-09-20). [go to v5]

Revision v1 (5 revisions archived).

Revisions (5)
  1. v1 current
  2. v2 [diff against previous]
  3. v3 [diff against previous]
  4. v4 [diff against previous]
  5. v5 [diff against previous]
Let's add the basic infrastructure to exclude some physical memory
regions completely from /dev/mem access, on any architecture and under
any system configuration (independent of CONFIG_STRICT_DEVMEM and
independent of "iomem=").

Use it for virtio-mem, to disallow mapping any virtio-mem memory via
/dev/mem to user space after the virtio-mem driver was loaded: there is
no sane use case to access the device-managed memory region via /dev/mem
once the driver is actively (un)plugging memory within that region and
we want to make sure that nobody will accidentially access unplugged
memory in a sane environment.

Details can be found in patch #1.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <redacted>
Cc: "Rafael J. Wysocki" <redacted>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Williams <redacted>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <redacted>
Cc: <redacted>

David Hildenbrand (3):
  /dev/mem: disallow access to explicitly excluded system RAM regions
  virtio-mem: disallow mapping virtio-mem memory via /dev/mem
  kernel/resource: cleanup and optimize iomem_is_exclusive()

 drivers/char/mem.c          | 22 ++++++-------
 drivers/virtio/virtio_mem.c |  4 ++-
 include/linux/ioport.h      |  1 +
 kernel/resource.c           | 61 ++++++++++++++++++++++++++++++++-----
 lib/Kconfig.debug           |  4 ++-
 5 files changed, 69 insertions(+), 23 deletions(-)

-- 
2.31.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help