Skip to content

Commit 8a3a592

Browse files
committed
linuxkm/lkcapi_glue.c: change WOLFSSL_LINUXKM_LKCAPI_PRIORITY from INT_MAX to 100000 to avoid overflows in kernel calculation of priority on constructed algs.
1 parent 6eb8dfb commit 8a3a592

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

linuxkm/lkcapi_glue.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,14 @@
5656
#ifndef WOLFSSL_LINUXKM_LKCAPI_PRIORITY
5757
/* Larger number means higher priority. The highest in-tree priority is
5858
* 4001, in the Cavium driver.
59+
*
60+
* Note bene, when the kernel dynamically constructs compound algorithms, it
61+
* computes their priorities by multiplying the priority of the base
62+
* algorithm by up to 10, and/or adding to it the priority of a second base
63+
* algorithm, or a constant up to 200, so it's not safe to use a value near
64+
* INT_MAX here.
5965
*/
60-
#define WOLFSSL_LINUXKM_LKCAPI_PRIORITY INT_MAX
66+
#define WOLFSSL_LINUXKM_LKCAPI_PRIORITY 100000
6167
#endif
6268

6369
#ifdef CONFIG_CRYPTO_MANAGER_EXTRA_TESTS

0 commit comments

Comments
 (0)