Re: [PATCH] firmware: arm_scmi: use strlcpy to ensure NULL-terminated strings

From: Olof Johansson
Date: Fri Sep 07 2018 - 13:14:36 EST


Hi,

On Fri, Sep 7, 2018 at 9:52 AM, Sudeep Holla <sudeep.holla@xxxxxxx> wrote:
> Replace all the memcpy() for copying name strings from the firmware with
> strlcpy() to make sure we are bounded by the source buffer size and we
> also always have NULL-terminated strings.
>
> This is needed to avoid out of bounds accesses if the firmware returns
> a non-terminated string.
>
> Reported-by: Olof Johansson <olof@xxxxxxxxx>
> Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>

In case I don't end up applying it:

Acked-by: Olof Johansson <olof@xxxxxxxxx>

> Let me know if this is rc/fix material or need to wait for v4.20 ?

I don't see a reason to merge this as a fix, it's more of a cleanup.


-Olof