linux/security/keys
Jarkko Sakkinen 050bf3c793 KEYS: trusted: Do not use WARN when encode fails
When asn1_encode_sequence() fails, WARN is not the correct solution.

1. asn1_encode_sequence() is not an internal function (located
   in lib/asn1_encode.c).
2. Location is known, which makes the stack trace useless.
3. Results a crash if panic_on_warn is set.

It is also noteworthy that the use of WARN is undocumented, and it
should be avoided unless there is a carefully considered rationale to
use it.

Replace WARN with pr_err, and print the return value instead, which is
only useful piece of information.

Cc: stable@vger.kernel.org # v5.13+
Fixes: f221974525 ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs")
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2024-05-21 02:35:10 +03:00
..
encrypted-keys Revert "KEYS: encrypted: Add check for strsep" 2024-01-24 16:11:59 -05:00
trusted-keys KEYS: trusted: Do not use WARN when encode fails 2024-05-21 02:35:10 +03:00
big_key.c
compat_dh.c
compat.c
dh.c
gc.c keys: update key quotas in key_put() 2024-05-09 16:28:58 +03:00
internal.h keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2023-12-21 13:47:38 +00:00
Kconfig
key.c keys: Fix overwrite of key expiration on instantiation 2024-05-09 16:28:58 +03:00
keyctl_pkey.c
keyctl.c keys: update key quotas in key_put() 2024-05-09 16:28:58 +03:00
keyring.c
Makefile
permission.c
persistent.c
proc.c keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2023-12-21 13:47:38 +00:00
process_keys.c
request_key_auth.c KEYS: Replace all non-returning strlcpy with strscpy 2023-08-17 20:12:35 +00:00
request_key.c
sysctl.c lsm: remove the now superfluous sentinel element from ctl_table array 2024-04-15 15:00:00 -04:00
user_defined.c