[PATCH v2 0/2] crypto: Fix memcpy_sglist()

Eric Biggers posted 2 patches 2 months, 3 weeks ago
crypto/scatterwalk.c               | 345 +++++++----------------------
crypto/skcipher.c                  | 261 +++++++++++++++++++++-
include/crypto/algapi.h            |  12 +
include/crypto/internal/skcipher.h |  48 +++-
include/crypto/scatterwalk.h       | 117 +++-------
5 files changed, 431 insertions(+), 352 deletions(-)
[PATCH v2 0/2] crypto: Fix memcpy_sglist()
Posted by Eric Biggers 2 months, 3 weeks ago
This series rewrites memcpy_sglist() to fix the bug where it called
functions that could fail and ignored errors.

This series is targeting crypto/master.

Changed in v2:
    - Don't try to support arbitrary overlaps
    - Use memcpy_page()

Eric Biggers (2):
  crypto: scatterwalk - Fix memcpy_sglist() to always succeed
  Revert "crypto: scatterwalk - Move skcipher walk and use it for
    memcpy_sglist"

 crypto/scatterwalk.c               | 345 +++++++----------------------
 crypto/skcipher.c                  | 261 +++++++++++++++++++++-
 include/crypto/algapi.h            |  12 +
 include/crypto/internal/skcipher.h |  48 +++-
 include/crypto/scatterwalk.h       | 117 +++-------
 5 files changed, 431 insertions(+), 352 deletions(-)


base-commit: 59b0afd01b2ce353ab422ea9c8375b03db313a21
-- 
2.51.2
Re: [PATCH v2 0/2] crypto: Fix memcpy_sglist()
Posted by Herbert Xu 2 months, 2 weeks ago
On Sat, Nov 15, 2025 at 03:08:15PM -0800, Eric Biggers wrote:
> This series rewrites memcpy_sglist() to fix the bug where it called
> functions that could fail and ignored errors.
> 
> This series is targeting crypto/master.
> 
> Changed in v2:
>     - Don't try to support arbitrary overlaps
>     - Use memcpy_page()
> 
> Eric Biggers (2):
>   crypto: scatterwalk - Fix memcpy_sglist() to always succeed
>   Revert "crypto: scatterwalk - Move skcipher walk and use it for
>     memcpy_sglist"
> 
>  crypto/scatterwalk.c               | 345 +++++++----------------------
>  crypto/skcipher.c                  | 261 +++++++++++++++++++++-
>  include/crypto/algapi.h            |  12 +
>  include/crypto/internal/skcipher.h |  48 +++-
>  include/crypto/scatterwalk.h       | 117 +++-------
>  5 files changed, 431 insertions(+), 352 deletions(-)
> 
> 
> base-commit: 59b0afd01b2ce353ab422ea9c8375b03db313a21
> -- 
> 2.51.2

Patch applied to cryptodev.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Re: [PATCH v2 0/2] crypto: Fix memcpy_sglist()
Posted by Herbert Xu 2 months, 3 weeks ago
On Sat, Nov 15, 2025 at 03:08:15PM -0800, Eric Biggers wrote:
> This series rewrites memcpy_sglist() to fix the bug where it called
> functions that could fail and ignored errors.
> 
> This series is targeting crypto/master.

While this is a worthwhile improvement, I don't think it's a bug
fix.  The only error that can actually happen is if you call
memcpy_tosglist from hard IRQ context.

Since there isn't any such usage in the current kernel, this is
purely an enhancement.

So I will be putting this into cryptodev and not crypto.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt