Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux

Pull devicetree bugfix from Grant Likely:
"Important bug fix for parsing 64-bit addresses on 32-bit platforms.
Without this patch the kernel will try to use memory ranges that
cannot be reached"

* tag 'dt-for-linus' of git://git.secretlab.ca/git/linux:
of: Check for phys_addr_t overflows in early_init_dt_add_memory_arch

Changed files
+15
drivers
of
+15
drivers/of/fdt.c
··· 880 880 const u64 phys_offset = __pa(PAGE_OFFSET); 881 881 base &= PAGE_MASK; 882 882 size &= PAGE_MASK; 883 + 884 + if (sizeof(phys_addr_t) < sizeof(u64)) { 885 + if (base > ULONG_MAX) { 886 + pr_warning("Ignoring memory block 0x%llx - 0x%llx\n", 887 + base, base + size); 888 + return; 889 + } 890 + 891 + if (base + size > ULONG_MAX) { 892 + pr_warning("Ignoring memory range 0x%lx - 0x%llx\n", 893 + ULONG_MAX, base + size); 894 + size = ULONG_MAX - base; 895 + } 896 + } 897 + 883 898 if (base + size < phys_offset) { 884 899 pr_warning("Ignoring memory block 0x%llx - 0x%llx\n", 885 900 base, base + size);