diff options
| author | Karl Mehltretter <kmehltretter@gmail.com> | 2026-08-08 13:48:48 +0200 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2026-08-15 11:28:36 +1000 |
| commit | 7537036a2e6fe96f8ed82034f755c54714a0e417 (patch) | |
| tree | c9c5514a0b7e55c669cc6ead704824191e3c78f8 /include | |
| parent | ff2ac77a034e03b64e2ba34f775097427dfa5547 (diff) | |
crypto: lskcipher - propagate errors from unaligned crypt
The while loop declares a second err variable that shadows the outer
one. When the crypt callback fails, the goto out path returns the outer
err, which still holds the -ENOMEM value assigned before the successful
allocation check. The real error from the cipher is discarded and the
caller sees -ENOMEM instead.
Drop the inner declaration so the callback error reaches the caller.
Verified with a test module that registers an lskcipher whose encrypt
callback fails with -EIO and calls it through a misaligned buffer.
An unpatched kernel returns -ENOMEM, a patched kernel returns -EIO.
Found with Clang's -Wshadow.
Fixes: 31865c4c4db2b ("crypto: skcipher - Add lskcipher")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
