From: Eric Biggers <ebiggers@kernel.org>
To: Colin Ian King <coking@nvidia.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S . Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: scatterwalk: propagate errors from failed call to skcipher_walk_first
Date: Fri, 14 Nov 2025 11:28:10 -0800 [thread overview]
Message-ID: <20251114192810.GA1687@quark> (raw)
In-Reply-To: <20251114122620.111623-1-coking@nvidia.com>
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@nvidia.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.
- Eric
next prev parent reply other threads:[~2025-11-14 19:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 12:26 [PATCH] crypto: scatterwalk: propagate errors from failed call to skcipher_walk_first Colin Ian King
2025-11-14 19:28 ` Eric Biggers [this message]
2025-11-14 23:02 ` Eric Biggers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251114192810.GA1687@quark \
--to=ebiggers@kernel.org \
--cc=coking@nvidia.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.