Re: [PATCH] crypto: algapi - make unregistration functions return void

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Dec 15, 2019 at 11:51:19PM +0000, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@xxxxxxxxxx>
> 
> Some of the algorithm unregistration functions return -ENOENT when asked
> to unregister a non-registered algorithm, while others always return 0
> or always return void.  But no users check the return value, except for
> two of the bulk unregistration functions which print a message on error
> but still always return 0 to their caller, and crypto_del_alg() which
> calls crypto_unregister_instance() which always returns 0.
> 
> Since unregistering a non-registered algorithm is always a kernel bug
> but there isn't anything callers should do to handle this situation at
> runtime, let's simplify things by making all the unregistration
> functions return void, and moving the error message into
> crypto_unregister_alg() and upgrading it to a WARN().
> 
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> ---
>  Documentation/crypto/devel-algos.rst | 34 ++++++++++------------------
>  crypto/acompress.c                   |  4 ++--
>  crypto/ahash.c                       |  4 ++--
>  crypto/algapi.c                      | 25 +++++++-------------
>  crypto/crypto_user_base.c            |  3 ++-
>  crypto/scompress.c                   |  4 ++--
>  crypto/shash.c                       | 19 +++++-----------
>  include/crypto/algapi.h              |  2 +-
>  include/crypto/internal/acompress.h  |  4 +---
>  include/crypto/internal/hash.h       |  6 ++---
>  include/crypto/internal/scompress.h  |  4 +---
>  include/linux/crypto.h               |  4 ++--
>  12 files changed, 42 insertions(+), 71 deletions(-)

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



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux