Centos-kernel-stream-9/security/keys
Štěpán Horáček e17edf9e68 KEYS: trusted: Do not use WARN when encode fails
JIRA: https://issues.redhat.com/browse/RHEL-52747

Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

commit 050bf3c793a07f96bd1e2fd62e1447f731ed733b
Author: Jarkko Sakkinen <jarkko@kernel.org>
Date:   Mon May 13 21:19:04 2024 +0300

    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>

Signed-off-by: Štěpán Horáček <shoracek@redhat.com>
2024-11-25 00:42:16 +01:00
..
encrypted-keys crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
trusted-keys KEYS: trusted: Do not use WARN when encode fails 2024-11-25 00:42:16 +01:00
Kconfig security: keys: trusted: use ASN.1 TPM2 key format for the blobs 2021-04-14 16:30:30 +03:00
Makefile
big_key.c security/keys: use kvfree_sensitive() 2021-01-21 16:16:09 +00:00
compat.c security/keys: remove compat_keyctl_instantiate_key_iov 2020-10-03 00:02:16 -04:00
compat_dh.c
dh.c crypto: dh - constify struct dh's pointer members 2023-01-09 13:32:41 -05:00
gc.c keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2024-01-15 15:27:11 +01:00
internal.h keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2024-01-15 15:27:11 +01:00
key.c keys: Fix overwrite of key expiration on instantiation 2024-06-07 18:09:22 +01:00
keyctl.c task_work: s/task_work_cancel()/task_work_cancel_func()/ 2024-09-04 14:25:56 +02:00
keyctl_pkey.c KEYS: remove redundant memset 2021-01-21 16:16:09 +00:00
keyring.c security: keys: delete repeated words in comments 2021-01-21 16:16:09 +00:00
permission.c
persistent.c
proc.c keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry 2024-01-15 15:27:11 +01:00
process_keys.c ucounts: Move get_ucounts from cred_alloc_blank to key_change_session_keyring 2021-11-05 13:50:32 +01:00
request_key.c keys: Fix linking a duplicate key to a keyring's assoc_array 2023-09-28 12:09:57 +10:00
request_key_auth.c
sysctl.c
user_defined.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00