All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem
@ 2021-08-11 20:36 ` David Hildenbrand
  0 siblings, 0 replies; 23+ messages in thread
From: David Hildenbrand @ 2021-08-11 20:36 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Hildenbrand, Arnd Bergmann, Greg Kroah-Hartman,
	Michael S. Tsirkin, Jason Wang, Rafael J. Wysocki, Andrew Morton,
	Dan Williams, Hanjun Guo, Andy Shevchenko, virtualization,
	linux-mm

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 <jasowang@redhat.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: virtualization@lists.linux-foundation.org
Cc: linux-mm@kvack.org

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2021-08-12 11:23 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 20:36 [PATCH v1 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem David Hildenbrand
2021-08-11 20:36 ` David Hildenbrand
2021-08-11 20:36 ` [PATCH v1 1/3] /dev/mem: disallow access to explicitly excluded system RAM regions David Hildenbrand
2021-08-11 20:36   ` David Hildenbrand
2021-08-11 20:50   ` Andy Shevchenko
2021-08-11 20:50     ` Andy Shevchenko
2021-08-11 20:36 ` [PATCH v1 2/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem David Hildenbrand
2021-08-11 20:36   ` David Hildenbrand
2021-08-11 20:36 ` [PATCH v1 3/3] kernel/resource: cleanup and optimize iomem_is_exclusive() David Hildenbrand
2021-08-11 20:36   ` David Hildenbrand
2021-08-11 20:47   ` Andy Shevchenko
2021-08-11 20:47     ` Andy Shevchenko
2021-08-12  7:07     ` David Hildenbrand
2021-08-12  7:07       ` David Hildenbrand
2021-08-12  7:07       ` David Hildenbrand
2021-08-12  7:14       ` Andy Shevchenko
2021-08-12  7:14         ` Andy Shevchenko
2021-08-12  7:34         ` David Hildenbrand
2021-08-12  7:34           ` David Hildenbrand
2021-08-12  7:34           ` David Hildenbrand
2021-08-12 11:15           ` Andy Shevchenko
2021-08-12 11:15             ` Andy Shevchenko
2021-08-12 11:15             ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.