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

pinctrl: imx: scu: Align imx sc msg structs 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: b96eea718bf6 ("pinctrl: fsl: add scu based pinctrl support")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Link: https://lore.kernel.org/r/bd7ad5fd755739a6d8d5f4f65e03b3ca4f457bd2.1582216144.git.leonard.crestez@nxp.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Leonard Crestez and committed by
Linus Walleij
4c48e549 dc7a06b0

+2 -2
+2 -2
drivers/pinctrl/freescale/pinctrl-scu.c
··· 23 23 struct imx_sc_rpc_msg hdr; 24 24 u32 val; 25 25 u16 pad; 26 - } __packed; 26 + } __packed __aligned(4); 27 27 28 28 struct imx_sc_msg_req_pad_get { 29 29 struct imx_sc_rpc_msg hdr; 30 30 u16 pad; 31 - } __packed; 31 + } __packed __aligned(4); 32 32 33 33 struct imx_sc_msg_resp_pad_get { 34 34 struct imx_sc_rpc_msg hdr;