Thread (9 messages) 9 messages, 5 authors, 2020-02-20

Re: [PATCH] firmware: imx: Align imx SC msg structs to 4

From: Stephen Boyd <sboyd@kernel.org>
Date: 2020-02-19 23:57:03
Also in: linux-clk, linux-gpio, linux-rtc

Quoting Leonard Crestez (2020-02-11 13:24:33)
The imx SC api strongly assumes that messages are composed out of
4-bytes words but some of our message structs have sizeof "6" and "7".

This produces many oopses with CONFIG_KASAN=y:

        BUG: KASAN: stack-out-of-bounds in imx_mu_send_data+0x108/0x1f0
Can you share the full kasan bug report instead of the single line?
It shouldn't cause an issues in normal use because these structs are
always allocated on the stack.
Is packed necessary for these? I thought that if the beginning of the
struct was naturally aligned and there was sometimes a byte or two at
the end then having __packed wasn't useful. So maybe it's better to just
drop __packed on all these structs and let the compiler decide it can
add some padding on the stack? Or do we have arrays of these structs
sitting in memory all next to each other and they need to be that way to
be sent through the mailbox?
Cc: stable@vger.kernel.org
Signed-off-by: Leonard Crestez <redacted>
Reported-by: Iuliana Prodan <redacted>
---
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help