]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Revert "restrict /dev/mem to idle io memory ranges"
authorChuck Anderson <chuck.anderson@oracle.com>
Tue, 4 Apr 2017 21:59:51 +0000 (14:59 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Tue, 30 May 2017 05:47:55 +0000 (22:47 -0700)
This reverts commit bf6ac7102b7207b2327a1b8259b89fd290b67412.
restrict /dev/mem to idle io memory ranges

There is an interaction with the bnx2i driver that prevents iSCSI logins.

Orabug: 25832750
Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
kernel/resource.c
lib/Kconfig.debug

index 3669d1bfc4254213e0e42dacab374624d74cdd5c..249b1eb1e6e1381c6963296db8c408f99a01b3b5 100644 (file)
@@ -1499,15 +1499,8 @@ int iomem_is_exclusive(u64 addr)
                        break;
                if (p->end < addr)
                        continue;
-               /*
-                * A resource is exclusive if IORESOURCE_EXCLUSIVE is set
-                * or CONFIG_IO_STRICT_DEVMEM is enabled and the
-                * resource is busy.
-                */
-               if ((p->flags & IORESOURCE_BUSY) == 0)
-                       continue;
-               if (IS_ENABLED(CONFIG_IO_STRICT_DEVMEM)
-                               || p->flags & IORESOURCE_EXCLUSIVE) {
+               if (p->flags & IORESOURCE_BUSY &&
+                    p->flags & IORESOURCE_EXCLUSIVE) {
                        err = 1;
                        break;
                }
index e911f7c9b014cdef2bdb4e6eb8c5900b9c290dca..af7bec643ae41bda50b7f84773abada21e5b8ea2 100644 (file)
@@ -1793,26 +1793,9 @@ config STRICT_DEVMEM
          enabled, even in this case there are restrictions on /dev/mem
          use due to the cache aliasing requirements.
 
-         If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
-         file only allows userspace access to PCI space and the BIOS code and
-         data regions.  This is sufficient for dosemu and X and all common
-         users of /dev/mem.
-
-         If in doubt, say Y.
-
-config IO_STRICT_DEVMEM
-       bool "Filter I/O access to /dev/mem"
-       depends on STRICT_DEVMEM
-       default STRICT_DEVMEM
-       ---help---
-         If this option is disabled, you allow userspace (root) access to all
-         io-memory regardless of whether a driver is actively using that
-         range.  Accidental access to this is obviously disastrous, but
-         specific access can be used by people debugging kernel drivers.
-
          If this option is switched on, the /dev/mem file only allows
-         userspace access to *idle* io-memory ranges (see /proc/iomem) This
-         may break traditional users of /dev/mem (dosemu, legacy X, etc...)
-         if the driver using a given range cannot be disabled.
+         userspace access to PCI space and the BIOS code and data regions.
+         This is sufficient for dosemu and X and all common users of
+         /dev/mem.
 
          If in doubt, say Y.