Skip to content

Commit 90edaac

Browse files
author
Ingo Molnar
committed
Revert "x86/mm: Limit mmap() of /dev/mem to valid physical addresses"
This reverts commit ce56a86. There's unanticipated interaction with some boot parameters like 'mem=', which now cause the new checks via valid_mmap_phys_addr_range() to be too restrictive, crashing a Qemu bootup in fact, as reported by Fengguang Wu. So while the motivation of the change is still entirely valid, we need a few more rounds of testing to get it right - it's way too late after -rc6, so revert it for now. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Craig Bergstrom <craigb@google.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Luis R. Rodriguez <mcgrof@suse.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Toshi Kani <toshi.kani@hp.com> Cc: dsafonov@virtuozzo.com Cc: kirill.shutemov@linux.intel.com Cc: mhocko@suse.com Cc: oleg@redhat.com Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 58c3862 commit 90edaac

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

arch/x86/include/asm/io.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ build_mmio_write(__writeq, "q", unsigned long, "r", )
110110

111111
#endif
112112

113-
#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
114-
extern int valid_phys_addr_range(phys_addr_t addr, size_t size);
115-
extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
116-
117113
/**
118114
* virt_to_phys - map virtual addresses to physical
119115
* @address: address to remap

arch/x86/mm/mmap.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,3 @@ const char *arch_vma_name(struct vm_area_struct *vma)
174174
return "[mpx]";
175175
return NULL;
176176
}
177-
178-
int valid_phys_addr_range(phys_addr_t addr, size_t count)
179-
{
180-
return addr + count <= __pa(high_memory);
181-
}
182-
183-
int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
184-
{
185-
phys_addr_t addr = (phys_addr_t)pfn << PAGE_SHIFT;
186-
187-
return valid_phys_addr_range(addr, count);
188-
}

0 commit comments

Comments
 (0)