File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,23 @@ static const struct attribute_group boot_attr_group = {
143143
144144static struct kobject * fpdt_kobj ;
145145
146+ #if defined CONFIG_X86 && defined CONFIG_PHYS_ADDR_T_64BIT
147+ #include <linux/processor.h>
148+ static bool fpdt_address_valid (u64 address )
149+ {
150+ /*
151+ * On some systems the table contains invalid addresses
152+ * with unsuppored high address bits set, check for this.
153+ */
154+ return !(address >> boot_cpu_data .x86_phys_bits );
155+ }
156+ #else
157+ static bool fpdt_address_valid (u64 address )
158+ {
159+ return true;
160+ }
161+ #endif
162+
146163static int fpdt_process_subtable (u64 address , u32 subtable_type )
147164{
148165 struct fpdt_subtable_header * subtable_header ;
@@ -151,6 +168,11 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type)
151168 u32 length , offset ;
152169 int result ;
153170
171+ if (!fpdt_address_valid (address )) {
172+ pr_info (FW_BUG "invalid physical address: 0x%llx!\n" , address );
173+ return - EINVAL ;
174+ }
175+
154176 subtable_header = acpi_os_map_memory (address , sizeof (* subtable_header ));
155177 if (!subtable_header )
156178 return - ENOMEM ;
You can’t perform that action at this time.
0 commit comments