[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251114230218.GA289091@quark>
Date: Fri, 14 Nov 2025 15:02:18 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: Colin Ian King <coking@...dia.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>,
linux-crypto@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: scatterwalk: propagate errors from failed call
to skcipher_walk_first
On Fri, Nov 14, 2025 at 11:28:10AM -0800, Eric Biggers wrote:
> On Fri, Nov 14, 2025 at 12:26:19PM +0000, Colin Ian King wrote:
> > There are cases where skcipher_walk_first can fail and errors such as
> > -ENOMEM or -EDEADLK are being ignored in memcpy_sglist. Add error checks
> > and propagate the error down to callers.
> >
> > This fixes silent data loss from callers to memcpy_sglist (since walk is
> > zero'd) or potential encryption on the wrong data.
> >
> > Signed-off-by: Colin Ian King <coking@...dia.com>
>
> There's no need for copying between two scatterlists to be able to fail.
> memcpy_sglist() should just be implemented from first principles instead
> of misusing the skcipher_walk stuff. I actually suggested this already
> (https://lore.kernel.org/linux-crypto/20250427010834.GB68006@quark/) but
> unfortunately it was disregarded.
Done at https://lore.kernel.org/linux-crypto/20251114225851.324143-2-ebiggers@kernel.org/
- Eric
Powered by blists - more mailing lists