[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210811203612.138506-1-david@redhat.com>
Date: Wed, 11 Aug 2021 22:36:09 +0200
From: David Hildenbrand <david@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: David Hildenbrand <david@...hat.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Hanjun Guo <guohanjun@...wei.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
virtualization@...ts.linux-foundation.org, linux-mm@...ck.org
Subject: [PATCH v1 0/3] virtio-mem: disallow mapping virtio-mem memory via /dev/mem
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@...db.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Jason Wang <jasowang@...hat.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Hanjun Guo <guohanjun@...wei.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: virtualization@...ts.linux-foundation.org
Cc: linux-mm@...ck.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
Powered by blists - more mailing lists