android_kernel_motorola_sm6375/security/keys
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Eric Biggers d312c0035e KEYS: fix length validation in keyctl_pkey_params_get_2()
commit c51abd96837f600d8fd940b6ab8e2da578575504 upstream.

In many cases, keyctl_pkey_params_get_2() is validating the user buffer
lengths against the wrong algorithm properties.  Fix it to check against
the correct properties.

Probably this wasn't noticed before because for all asymmetric keys of
the "public_key" subtype, max_data_size == max_sig_size == max_enc_size
== max_dec_size.  However, this isn't necessarily true for the
"asym_tpm" subtype (it should be, but it's not strictly validated).  Of
course, future key types could have different values as well.

Fixes: 00d60fd3b9 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]")
Cc: <stable@vger.kernel.org> # v4.20+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-15 14:17:58 +02:00
..
encrypted-keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:36:45 +02:00
big_key.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:36:45 +02:00
compat.c
compat_dh.c
dh.c
gc.c
internal.h mm: add kvfree_sensitive() for freeing sensitive data objects 2020-06-17 16:40:23 +02:00
Kconfig
key.c certs: Fix blacklist flag type confusion 2021-03-04 10:26:29 +01:00
keyctl.c mm: add kvfree_sensitive() for freeing sensitive data objects 2020-06-17 16:40:23 +02:00
keyctl_pkey.c KEYS: fix length validation in keyctl_pkey_params_get_2() 2022-04-15 14:17:58 +02:00
keyring.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:36:45 +02:00
Makefile
permission.c
persistent.c
proc.c
process_keys.c
request_key.c
request_key_auth.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:36:45 +02:00
sysctl.c
trusted.c KEYS: trusted: Fix migratable=1 failing 2021-03-04 10:26:44 +01:00
user_defined.c KEYS: Don't write out to userspace while holding key semaphore 2020-04-23 10:36:45 +02:00