linux/security/keys/encrypted-keys
David Laight 44b9597fea keys: Replace strcpy(derived_buf, "AUTH_KEY") with strscpy(..., HASH_SIZE)
derived_buf is guaranteed to be HASH_SIZE - and it is more than enough.
The strscpy() degenerates into an memcpy() (as did the strcpy()).
Do the same for the associated "ENC_KEY" copy.

Removes a possibly unbounded strcpy().

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20260606202633.5018-9-david.laight.linux@gmail.com
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2026-06-15 15:19:13 +03:00
..
ecryptfs_format.c keys: Replace deprecated strncpy in ecryptfs_fill_auth_tok 2025-11-27 23:50:20 +02:00
ecryptfs_format.h Replace HTTP links with HTTPS ones: security 2020-08-06 12:00:05 -07:00
encrypted.c keys: Replace strcpy(derived_buf, "AUTH_KEY") with strscpy(..., HASH_SIZE) 2026-06-15 15:19:13 +03:00
encrypted.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
masterkey_trusted.c Replace HTTP links with HTTPS ones: security 2020-08-06 12:00:05 -07:00