linux/drivers/s390/crypto
Harald Freudenberger 98d23edcd4 s390/zcrypt: Fix uninitialized padding in CRT key structure
The zcrypt_type6_crt_key() function leaves padding bytes uninitialized
between key components and the modulus in the CCA CRT key token. These
padding bytes are sent to the crypto card, potentially leaking kernel
memory contents.

The initial memset() only zeros fixed structure fields, not the
flexible array member key_parts[] where the padding resides. While key
components are properly copied from userspace, the calculated pad_len
bytes between them remain uninitialized.

Fix by explicitly zeroing the padding bytes after copying the CRT key
components.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Finn Callies <fcallies@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2026-09-01 12:44:48 +02:00
..
ap_bus.c s390/ap: Use mutex_lock_killable() in ap_bus_force_rescan() 2026-07-30 00:29:08 +02:00
ap_bus.h s390/ap: Fix queue depth field length 2026-07-31 13:31:30 +02:00
ap_card.c s390/ap: Fix MAPML computation 2026-08-05 15:16:54 +02:00
ap_debug.h s390/zcrypt: introduce dynamic debugging for AP and zcrypt code 2024-02-16 14:30:12 +01:00
ap_queue.c s390/ap: Fix locking issue in SE bind and associate sysfs functions 2026-06-09 19:33:00 +02:00
Makefile s390/pkey: Add new pkey handler module pkey-uv 2024-10-29 11:17:18 +01:00
pkey_api.c s390/pkey: Rework ioctl functions error paths 2026-07-30 00:29:09 +02:00
pkey_base.c s390/pkey: Add comment about synchronize_rcu() to pkey base 2026-04-02 12:06:29 +02:00
pkey_base.h s390/pkey: Provide and pass xflags within pkey and zcrypt layers 2025-04-30 11:34:03 +02:00
pkey_cca.c s390/zcrypt: Fix buffer over-read in cca_cipher2protkey 2026-07-31 13:31:19 +02:00
pkey_ep11.c s390/pkey: Support new xflag PKEY_XFLAG_NOCLEARKEY 2026-01-31 10:52:30 +08:00
pkey_pckmo.c s390/pkey: Check length in pkey_pckmo handler implementation 2026-06-19 14:51:08 +02:00
pkey_sysfs.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
pkey_uv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vfio_ap_debug.h s390-vfio-ap: introduces s390 kernel debug feature for vfio_ap device driver 2022-02-06 23:31:29 +01:00
vfio_ap_drv.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
vfio_ap_ops.c s390/vfio-ap: Fix NULL deref in status_show() during queue probe 2026-08-13 16:04:33 +02:00
vfio_ap_private.h s390/vfio-ap: Signal eventfd when guest AP configuration is changed 2025-02-18 18:53:48 +01:00
zcrypt_api.c s390/zcrypt: Close speculative mem read possibility 2026-07-31 13:31:19 +02:00
zcrypt_api.h s390/ap/zcrypt: Rearrange fields within AP and zcrypt structs 2026-06-03 15:32:43 +02:00
zcrypt_card.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
zcrypt_cca_key.h s390/zcrypt: Fix uninitialized padding in CRT key structure 2026-09-01 12:44:48 +02:00
zcrypt_ccamisc.c s390/zcrypt: Validate length in reply before using it 2026-08-31 16:25:38 +02:00
zcrypt_ccamisc.h s390/zcrypt: Fix buffer over-read in cca_cipher2protkey 2026-07-31 13:31:19 +02:00
zcrypt_cex4.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
zcrypt_cex4.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zcrypt_debug.h s390/zcrypt: introduce dynamic debugging for AP and zcrypt code 2024-02-16 14:30:12 +01:00
zcrypt_ep11misc.c s390/zcrypt: Fix CPRB memory allocation in zcrypt misc code 2026-08-05 15:12:22 +02:00
zcrypt_ep11misc.h s390/ap/zcrypt: Rearrange fields within AP and zcrypt structs 2026-06-03 15:32:43 +02:00
zcrypt_error.h s390/zcrypt: Make apfs a real unsigned int field 2026-03-24 21:00:41 +01:00
zcrypt_msgtype6.c s390/zcrypt: Pad trailing CCA or EP11 message with zeros 2026-08-05 15:12:22 +02:00
zcrypt_msgtype6.h s390/zcrypt: Make apfs a real unsigned int field 2026-03-24 21:00:41 +01:00
zcrypt_msgtype50.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
zcrypt_msgtype50.h s390/zcrypt: remove CEX2 and CEX3 device drivers 2023-07-24 12:12:22 +02:00
zcrypt_queue.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00