Jia Jie Ho
d7f01649f4
crypto: starfive - Do not free stack buffer
...
RSA text data uses variable length buffer allocated in software stack.
Calling kfree on it causes undefined behaviour in subsequent operations.
Cc: <stable@vger.kernel.org > #6.7+
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2024-05-10 17:15:24 +08:00
Jia Jie Ho
25ca4a85e9
crypto: starfive - Skip unneeded fallback allocation
...
Skip sw fallback allocation if RSA module failed to get device handle.
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2024-05-10 17:15:24 +08:00
Jia Jie Ho
a05c821e42
crypto: starfive - Skip unneeded key free
...
Skip unneeded kfree_sensitive if RSA module is using falback algo.
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2024-04-02 10:49:38 +08:00
Jia Jie Ho
555e387047
crypto: starfive - Remove unneeded NULL checks
...
NULL check before kfree_sensitive function is not needed.
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com >
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202311301702.LxswfETY-lkp@intel.com/
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2023-12-15 17:52:52 +08:00
Jia Jie Ho
ba6e3ee4f5
crypto: starfive - RSA poll csr for done status
...
Hardware could not clear irq status without resetting the entire module.
Driver receives irq immediately when mask bit is cleared causing
intermittent errors in RSA calculations. Switch to use csr polling for
done status instead.
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2023-11-24 18:13:56 +08:00
Jia Jie Ho
445a4aaf58
crypto: starfive - Add RSA algo support
...
Adding RSA enc/dec and sign/verify feature for StarFive cryptographic
module. The module only supports mod sizes up to 2048, therefore
calculations more than that will use fallback algo.
Co-developed-by: Huan Feng <huan.feng@starfivetech.com >
Signed-off-by: Huan Feng <huan.feng@starfivetech.com >
Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com >
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au >
2023-06-23 16:15:36 +08:00