[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZP7gvmd+D2fg9DD0@duo.ucw.cz>
Date: Mon, 11 Sep 2023 11:41:18 +0200
From: Pavel Machek <pavel@...x.de>
To: Sasha Levin <sashal@...nel.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Azeem Shaikh <azeemshaikh38@...il.com>,
Kees Cook <keescook@...omium.org>,
Herbert Xu <herbert@...dor.apana.org.au>, davem@...emloft.net,
linux-crypto@...r.kernel.org
Subject: Re: [PATCH AUTOSEL 5.10 02/14] crypto: lrw,xts - Replace strlcpy
with strscpy
On Fri 2023-09-08 14:19:49, Sasha Levin wrote:
> From: Azeem Shaikh <azeemshaikh38@...il.com>
>
> [ Upstream commit babb80b3ecc6f40c962e13c654ebcd27f25ee327 ]
>
> strlcpy() reads the entire source buffer first.
> This read may exceed the destination size limit.
> This is both inefficient and can lead to linear read
> overflows if a source string is not NUL-terminated [1].
> In an effort to remove strlcpy() completely [2], replace
> strlcpy() here with strscpy().
>
> Direct replacement is safe here since return value of -errno
> is used to check for truncation instead of sizeof(dest).
We don't need this in stable, do we?
BR,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists