Skip to content

Commit

Permalink
crypto: api - Disallow identical driver names
Browse files Browse the repository at this point in the history
commit 27016f7 upstream.

Disallow registration of two algorithms with identical driver names.

Cc: <stable@vger.kernel.org>
Reported-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
herbertx authored and gregkh committed Feb 1, 2024
1 parent f36d200 commit b1a67a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ __crypto_register_alg(struct crypto_alg *alg, struct list_head *algs_to_put)
}

if (!strcmp(q->cra_driver_name, alg->cra_name) ||
!strcmp(q->cra_driver_name, alg->cra_driver_name) ||
!strcmp(q->cra_name, alg->cra_driver_name))
goto err;
}
Expand Down

0 comments on commit b1a67a0

Please sign in to comment.