]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/x86/mm/ioremap.c
IO resources, x86: ioremap sanity check to catch mapping requests exceeding the BAR...
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / mm / ioremap.c
index d4b6e6a29ae3597c45071805f734a502a12d6ab2..c818b45bd07d3bade0b48174b0436d39f4134fd2 100644 (file)
@@ -149,6 +149,12 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
        if (is_ISA_range(phys_addr, last_addr))
                return (__force void __iomem *)phys_to_virt(phys_addr);
 
+       /*
+        * Check if the request spans more than any BAR in the iomem resource
+        * tree.
+        */
+       WARN_ON(iomem_map_sanity_check(phys_addr, size));
+
        /*
         * Don't allow anybody to remap normal RAM that we're using..
         */