Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: imx: Align imx_sc_msg_req_cpu_start to 4

The imx SC api strongly assumes that messages are composed out of
4-bytes words but some of our message structs have odd sizeofs.

This produces many oopses with CONFIG_KASAN=y.

Fix by marking with __aligned(4).

Fixes: d90bf296ae18 ("firmware: imx: Add support to start/stop a CPU")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Leonard Crestez and committed by
Shawn Guo
f5bfeff4 7c1a1c81

+1 -1
+1 -1
drivers/firmware/imx/misc.c
··· 24 24 u32 address_lo; 25 25 u16 resource; 26 26 u8 enable; 27 - } __packed; 27 + } __packed __aligned(4); 28 28 29 29 struct imx_sc_msg_req_misc_get_ctrl { 30 30 struct imx_sc_rpc_msg hdr;