WSL2-Linux-Kernel/drivers/of
Paul Burton de96ec2a77 OF: Prevent unaligned access in of_alias_scan()
When allocating a struct alias_prop, of_alias_scan() only requested that
it be aligned on a 4 byte boundary. The struct contains pointers which
leads to us attempting 64 bit writes on 64 bit systems, and if the CPU
doesn't support unaligned memory accesses then this causes problems -
for example on some MIPS64r2 CPUs including the "mips64r2-generic" QEMU
emulated CPU it will trigger an address error exception.

Fix this by requesting alignment for the struct alias_prop allocation
matching that which the compiler expects, using the __alignof__ keyword.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14306/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2017-01-03 16:34:48 +01:00
..
unittest-data
Kconfig
Makefile
address.c
base.c OF: Prevent unaligned access in of_alias_scan() 2017-01-03 16:34:48 +01:00
device.c
dynamic.c
fdt.c of: Add check to of_scan_flat_dt() before accessing initial_boot_params 2017-01-03 16:34:43 +01:00
fdt_address.c
irq.c
of_mdio.c
of_net.c
of_numa.c
of_pci.c
of_pci_irq.c
of_private.h
of_reserved_mem.c
overlay.c
pdt.c
platform.c
resolver.c
unittest.c