Skip to content

Commit 65c582d

Browse files
MingcongBaiopsiff
authored andcommitted
AOSCOS: crypto: padlock-sha: return -ENODEV on Zhaoxin KaiXian KX-6000/6000G
On Zhaoxin KaiXian KX-6000/6000G series of processors, this crypto module causes a null pointer dereference. Zhaoxin submitted upstream an implementation update but does not specify a fix. Per our testing, blacklisting this module causes the null pointer dereference to go away. Block x86 Family 7 Model 59 for now. Link: https://lore.kernel.org/all/20250114121301.156359-1-TonyWWang-oc%40zhaoxin.com/ */ Signed-off-by: Mingcong Bai <jeffbai@aosc.io> (cherry picked from commit 2eab5747c68dff5b3f7e7f70740887b8eda51abe) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent b4a38ac commit 65c582d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/crypto/padlock-sha.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,17 @@ static int __init padlock_init(void)
329329
struct shash_alg *sha1;
330330
struct shash_alg *sha256;
331331

332-
if (!x86_match_cpu(padlock_sha_ids) || !boot_cpu_has(X86_FEATURE_PHE_EN))
332+
/* On Zhaoxin KaiXian KX-6000/6000G series of processors, this crypto
333+
* module causes a null pointer dereference.
334+
*
335+
* Zhaoxin submitted upstream an implementation update but does not
336+
* specify a fix. Per our testing, blacklisting this module causes the
337+
* null pointer dereference to go away.
338+
*
339+
* Link: https://lore.kernel.org/all/20250114121301.156359-1-TonyWWang-oc%40zhaoxin.com/ */
340+
if (!x86_match_cpu(padlock_sha_ids) ||
341+
!boot_cpu_has(X86_FEATURE_PHE_EN) ||
342+
(c->x86 == 7 && c->x86_model == 59))
333343
return -ENODEV;
334344

335345
/* Register the newly added algorithm module if on *

0 commit comments

Comments
 (0)