From: Chuck Anderson Date: Tue, 4 Apr 2017 21:59:51 +0000 (-0700) Subject: Revert "restrict /dev/mem to idle io memory ranges" X-Git-Tag: v4.1.12-102.0.20170529_2200~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8ba1b9a0ef5f475b26690afe8c354cdb41b8ba08;p=users%2Fjedix%2Flinux-maple.git Revert "restrict /dev/mem to idle io memory ranges" 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 Reviewed-by: Jack Vogel --- diff --git a/kernel/resource.c b/kernel/resource.c index 3669d1bfc4254..249b1eb1e6e13 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -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; } diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e911f7c9b014c..af7bec643ae41 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -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.