Jarkko Sakkinen
1408d27f25
tpm: Add !tpm_amd_is_rng_defective() to the hwrng_unregister() call site
commit bd8621ca15 upstream.
The following crash was reported:
[ 1950.279393] list_del corruption, ffff99560d485790->next is NULL
[ 1950.279400] ------------[ cut here ]------------
[ 1950.279401] kernel BUG at lib/list_debug.c:49!
[ 1950.279405] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
[ 1950.279407] CPU: 11 PID: 5886 Comm: modprobe Tainted: G O 6.2.8_1 #1
[ 1950.279409] Hardware name: Gigabyte Technology Co., Ltd. B550M AORUS PRO-P/B550M AORUS PRO-P,
BIOS F15c 05/11/2022
[ 1950.279410] RIP: 0010:__list_del_entry_valid+0x59/0xc0
[ 1950.279415] Code: 48 8b 01 48 39 f8 75 5a 48 8b 72 08 48 39 c6 75 65 b8 01 00 00 00 c3 cc cc cc
cc 48 89 fe 48 c7 c7 08 a8 13 9e e8 b7 0a bc ff <0f> 0b 48 89 fe 48 c7 c7 38 a8 13 9e e8 a6 0a bc
ff 0f 0b 48 89 fe
[ 1950.279416] RSP: 0018:ffffa96d05647e08 EFLAGS: 00010246
[ 1950.279418] RAX: 0000000000000033 RBX: ffff99560d485750 RCX: 0000000000000000
[ 1950.279419] RDX: 0000000000000000 RSI: ffffffff9e107c59 RDI: 00000000ffffffff
[ 1950.279420] RBP: ffffffffc19c5168 R08: 0000000000000000 R09: ffffa96d05647cc8
[ 1950.279421] R10: 0000000000000003 R11: ffffffff9ea2a568 R12: 0000000000000000
[ 1950.279422] R13: ffff99560140a2e0 R14: ffff99560127d2e0 R15: 0000000000000000
[ 1950.279422] FS: 00007f67da795380(0000) GS:ffff995d1f0c0000(0000) knlGS:0000000000000000
[ 1950.279424] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1950.279424] CR2: 00007f67da7e65c0 CR3: 00000001feed2000 CR4: 0000000000750ee0
[ 1950.279426] PKRU: 55555554
[ 1950.279426] Call Trace:
[ 1950.279428] <TASK>
[ 1950.279430] hwrng_unregister+0x28/0xe0 [rng_core]
[ 1950.279436] tpm_chip_unregister+0xd5/0xf0 [tpm]
Add the forgotten !tpm_amd_is_rng_defective() invariant to the
hwrng_unregister() call site inside tpm_chip_unregister().
Cc: stable@vger.kernel.org
Reported-by: Martin Dimov <martin@dmarto.com>
Link: https://lore.kernel.org/linux-integrity/3d1d7e9dbfb8c96125bc93b6b58b90a7@dmarto.com/
Fixes: f1324bbc40 ("tpm: disable hwrng for fTPM on some AMD designs")
Fixes: b006c439d5 ("hwrng: core - start hwrng kthread also for untrusted sources")
Tested-by: Martin Dimov <martin@dmarto.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:03:00 +09:00
..
2023-01-24 07:24:37 +01:00
2023-04-20 12:35:12 +02:00
2023-03-10 09:32:32 +01:00
2023-03-30 12:49:09 +02:00
2023-03-11 13:55:16 +01:00
2023-05-01 08:26:27 +09:00
2023-04-20 12:35:11 +02:00
2023-04-20 12:35:06 +02:00
2023-03-30 12:49:29 +02:00
2023-05-11 23:03:00 +09:00
2023-04-20 12:35:08 +02:00
2023-03-10 09:33:03 +01:00
2023-01-24 07:24:35 +01:00
2023-04-13 16:55:31 +02:00
2023-03-10 09:33:01 +01:00
2023-03-22 13:34:04 +01:00
2023-03-10 09:34:19 +01:00
2023-04-13 16:55:25 +02:00
2023-03-10 09:34:25 +01:00
2023-01-07 11:11:40 +01:00
2022-12-31 13:32:38 +01:00
2023-04-20 12:35:08 +02:00
2023-02-09 11:28:23 +01:00
2023-02-01 08:34:40 +01:00
2022-12-31 13:32:39 +01:00
2023-02-09 11:27:59 +01:00
2023-04-20 12:35:11 +02:00
2023-04-26 14:28:43 +02:00
2023-02-09 11:28:04 +01:00
2023-05-01 08:26:27 +09:00
2023-05-01 08:26:27 +09:00
2023-04-20 12:35:13 +02:00
2022-12-31 13:32:45 +01:00
2023-04-13 16:55:18 +02:00
2023-05-11 23:03:00 +09:00
2023-04-13 16:55:30 +02:00
2023-04-20 12:35:14 +02:00
2023-04-06 12:10:58 +02:00
2023-05-11 23:02:58 +09:00
2023-04-20 12:35:10 +02:00
2023-04-26 14:28:43 +02:00
2023-03-30 12:48:59 +02:00
2023-04-06 12:10:49 +02:00
2023-03-10 09:33:07 +01:00
2023-02-09 11:28:04 +01:00
2023-04-13 16:55:18 +02:00
2023-03-17 08:50:31 +01:00
2022-12-31 13:32:55 +01:00
2022-12-31 13:32:41 +01:00
2023-04-13 16:55:17 +02:00
2023-03-22 13:33:53 +01:00
2023-03-22 13:33:56 +01:00
2023-04-26 14:28:39 +02:00
2023-03-11 13:55:32 +01:00
2023-03-11 13:55:39 +01:00
2023-04-26 14:28:40 +02:00
2023-04-26 14:28:37 +02:00
2023-05-11 23:02:58 +09:00
2023-03-22 13:33:46 +01:00
2023-03-10 09:34:20 +01:00
2023-04-26 14:28:37 +02:00
2023-02-09 11:28:25 +01:00
2023-02-22 12:59:46 +01:00
2023-03-10 09:33:01 +01:00
2023-01-07 11:11:55 +01:00
2023-05-11 23:02:59 +09:00
2023-02-01 08:34:49 +01:00
2023-05-11 23:02:59 +09:00
2023-04-20 12:35:05 +02:00
2023-05-11 23:02:58 +09:00
2023-04-20 12:35:10 +02:00
2023-03-10 09:32:56 +01:00
2023-04-06 12:10:44 +02:00
2023-04-13 16:55:19 +02:00
2023-04-26 14:28:32 +02:00
2023-03-10 09:34:26 +01:00
2023-02-01 08:34:05 +01:00
2023-03-10 09:33:45 +01:00
2023-03-11 13:55:30 +01:00
2023-04-06 12:10:46 +02:00
2023-05-11 23:02:58 +09:00
2023-03-30 12:49:29 +02:00
2023-03-11 13:55:40 +01:00
2023-04-26 14:28:34 +02:00
2023-03-17 08:50:16 +01:00
2023-03-30 12:49:17 +02:00
2023-03-30 12:49:29 +02:00
2023-03-11 13:55:32 +01:00
2023-04-06 12:10:33 +02:00
2023-04-13 16:55:28 +02:00
2023-03-30 12:49:17 +02:00
2022-12-31 13:32:38 +01:00
2023-05-11 23:03:00 +09:00
2023-03-22 13:34:03 +01:00
2023-03-10 09:34:32 +01:00
2023-03-22 13:33:44 +01:00
2023-04-20 12:35:07 +02:00
2023-03-22 13:34:06 +01:00
2023-01-24 07:24:31 +01:00
2023-02-01 08:34:26 +01:00
2023-03-11 13:55:24 +01:00
2023-03-10 09:33:02 +01:00