Roman Smirnov 70fd1966c9 KEYS: prevent NULL pointer dereference in find_asymmetric_key()
In find_asymmetric_key(), if all NULLs are passed in the id_{0,1,2}
arguments, the kernel will first emit WARN but then have an oops
because id_2 gets dereferenced anyway.

Add the missing id_2 check and move WARN_ON() to the final else branch
to avoid duplicate NULL checks.

Found by Linux Verification Center (linuxtesting.org) with Svace static
analysis tool.

Cc: stable@vger.kernel.org # v5.17+
Fixes: 7d30198ee24f ("keys: X.509 public key issuer lookup without AKID")
Suggested-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2024-09-20 19:49:49 +03:00
..
2024-04-02 10:49:38 +08:00
2024-04-02 10:49:38 +08:00
2024-04-02 10:49:38 +08:00
2023-12-08 11:59:46 +08:00
2024-02-02 18:08:12 +08:00
2024-04-02 10:49:38 +08:00
2024-08-17 13:55:50 +08:00
2023-11-17 19:16:29 +08:00
2024-04-02 10:49:38 +08:00
2024-08-24 21:36:07 +08:00
2024-04-02 10:49:38 +08:00
2024-04-02 10:49:38 +08:00
2024-06-07 19:46:39 +08:00
2020-02-28 08:43:21 +08:00
2023-02-14 13:39:33 +08:00
2024-04-02 10:49:38 +08:00
2024-04-02 10:49:38 +08:00
2022-12-02 18:12:40 +08:00
2024-04-02 10:49:38 +08:00
2024-04-02 10:49:38 +08:00
2024-04-02 10:49:38 +08:00
2024-04-02 10:49:38 +08:00
2022-04-08 16:12:46 +08:00
2022-12-02 18:12:40 +08:00
2024-09-06 14:50:46 +08:00
2024-06-07 19:46:39 +08:00
2023-10-27 18:04:24 +08:00
2022-06-10 16:40:16 +08:00
2024-08-02 20:53:25 +08:00
2021-11-08 16:55:21 -08:00