CVE-2024-26957: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: s390/zcrypt: fix reference counting on zcrypt card objects Tests with hot-plugging crytpo cards on KVM guests with debug kernel build revealed an use after free for the load field of the struct zcrypt_card. The reason was an incorrect reference handling of the zcrypt card object which could lead to a free of the zcrypt card object while it was still in use. This is an example of the slab message: kernel: 0x00000000885a7512-0x00000000885a7513 @offset=1298. First byte 0x68 instead of 0x6b kernel: Allocated in zcrypt_card_alloc+0x36/0x70 [zcrypt] age=18046 cpu=3 pid=43 kernel: kmalloc_trace+0x3f2/0x470 kernel: zcrypt_card_alloc+0x36/0x70 [zcrypt] kernel: zcrypt_cex4_card_probe+0x26/0x380 [zcrypt_cex4] kernel: ap_device_probe+0x15c/0x290 kernel: really_probe+0xd2/0x468 kernel: driver_probe_device+0x40/0xf0 kernel: __device_attach_driver+0xc0/0x140 kernel: bus_for_each_drv+0x8c/0xd0 kernel: __device_attach+0x114/0x198 kernel: bus_probe_device+0xb4/0xc8 kernel: device_add+0x4d2/0x6e0 kernel: ap_scan_adapter+0x3d0/0x7c0 kernel: ap_scan_bus+0x5a/0x3b0 kernel: ap_scan_bus_wq_callback+0x40/0x60 kernel: process_one_work+0x26e/0x620 kernel: worker_thread+0x21c/0x440 kernel: Freed in zcrypt_card_put+0x54/0x80 [zcrypt] age=9024 cpu=3 pid=43 kernel: kfree+0x37e/0x418 kernel: zcrypt_card_put+0x54/0x80 [zcrypt] kernel: ap_device_remove+0x4c/0xe0 kernel: device_release_driver_internal+0x1c4/0x270 kernel: bus_remove_device+0x100/0x188 kernel: device_del+0x164/0x3c0 kernel: device_unregister+0x30/0x90 kernel: ap_scan_adapter+0xc8/0x7c0 kernel: ap_scan_bus+0x5a/0x3b0 kernel: ap_scan_bus_wq_callback+0x40/0x60 kernel: process_one_work+0x26e/0x620 kernel: worker_thread+0x21c/0x440 kernel: kthread+0x150/0x168 kernel: __ret_from_fork+0x3c/0x58 kernel: ret_from_fork+0xa/0x30 kernel: Slab 0x00000372022169c0 objects=20 used=18 fp=0x00000000885a7c88 flags=0x3ffff00000000a00(workingset|slab|node=0|zone=1|lastcpupid=0x1ffff) kernel: Object 0x00000000885a74b8 @offset=1208 fp=0x00000000885a7c88 kernel: Redzone 00000000885a74b0: bb bb bb bb bb bb bb bb ........ kernel: Object 00000000885a74b8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74c8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74d8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74e8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74f8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a7508: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 68 4b 6b 6b 6b a5 kkkkkkkkkkhKkkk. kernel: Redzone 00000000885a7518: bb bb bb bb bb bb bb bb ........ kernel: Padding 00000000885a756c: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZ kernel: CPU: 0 PID: 387 Comm: systemd-udevd Not tainted 6.8.0-HF #2 kernel: Hardware name: IBM 3931 A01 704 (KVM/Linux) kernel: Call Trace: kernel: [<00000000ca5ab5b8>] dump_stack_lvl+0x90/0x120 kernel: [<00000000c99d78bc>] check_bytes_and_report+0x114/0x140 kernel: [<00000000c99d53cc>] check_object+0x334/0x3f8 kernel: [<00000000c99d820c>] alloc_debug_processing+0xc4/0x1f8 kernel: [<00000000c99d852e>] get_partial_node.part.0+0x1ee/0x3e0 kernel: [<00000000c99d94ec>] ___slab_alloc+0xaf4/0x13c8 kernel: [<00000000c99d9e38>] __slab_alloc.constprop.0+0x78/0xb8 kernel: [<00000000c99dc8dc>] __kmalloc+0x434/0x590 kernel: [<00000000c9b4c0ce>] ext4_htree_store_dirent+0x4e/0x1c0 kernel: [<00000000c9b908a2>] htree_dirblock_to_tree+0x17a/0x3f0 kernel: ---truncated---
AI Analysis
Technical Summary
CVE-2024-26957 is a use-after-free vulnerability identified in the Linux kernel's s390 architecture cryptographic subsystem, specifically within the zcrypt card object management. The vulnerability arises due to incorrect reference counting on zcrypt card objects, which are hardware cryptographic accelerator cards used primarily on IBM Z (s390) mainframe systems. During operations such as hot-plugging crypto cards in KVM guest environments with debug kernel builds, it was observed that the 'load' field of the struct zcrypt_card could be accessed after the object had been freed. This use-after-free condition results from improper handling of the reference count, leading to premature freeing of the zcrypt card object while it is still in use. The kernel logs and stack traces indicate that the allocation and freeing of these objects occur in functions like zcrypt_card_alloc and zcrypt_card_put, respectively. The flaw is categorized under CWE-416 (Use After Free), which can lead to undefined behavior including memory corruption, kernel crashes, or potentially arbitrary code execution if exploited. Although no known exploits are currently reported in the wild, the vulnerability affects Linux kernel versions containing the specified commit hashes and is relevant for systems utilizing the zcrypt subsystem, notably IBM Z mainframes running Linux. The vulnerability was discovered through rigorous testing involving hot-plugging cryptographic cards on KVM guests with debug kernels, highlighting a race condition or reference counting flaw in the kernel's device driver code for cryptographic hardware. The patch involves correcting the reference counting mechanism to ensure that zcrypt card objects are not freed while still in use, preventing use-after-free scenarios.
Potential Impact
For European organizations, the impact of CVE-2024-26957 is primarily relevant to those operating IBM Z mainframe systems running Linux, especially in environments that utilize hardware cryptographic accelerators for secure processing tasks. Such systems are often employed in critical sectors like banking, finance, government, and large enterprises where high-assurance cryptographic operations are essential. Exploitation of this vulnerability could lead to kernel crashes resulting in denial of service, or potentially allow an attacker with sufficient privileges to execute arbitrary code within the kernel context, compromising system confidentiality, integrity, and availability. Given the specialized nature of the affected subsystem and hardware, the threat surface is limited to organizations using s390 architecture Linux kernels with zcrypt cards. However, the criticality of these systems in processing sensitive data means that any compromise could have severe operational and reputational consequences. Additionally, the vulnerability could be leveraged in multi-tenant virtualized environments (KVM guests) to escalate privileges or disrupt services. The absence of known exploits reduces immediate risk, but the potential for exploitation in targeted attacks against high-value mainframe environments remains a concern.
Mitigation Recommendations
European organizations using IBM Z mainframes with Linux kernels should prioritize applying the official patches that correct the reference counting in the zcrypt card driver to eliminate the use-after-free condition. Since the vulnerability involves kernel-level code, updating to the latest stable Linux kernel versions containing the fix is essential. Organizations should also audit their systems to identify the presence of zcrypt hardware and assess whether their kernel versions are affected. In virtualized environments, particularly those using KVM guests with hot-pluggable crypto cards, additional caution should be exercised by limiting hot-plug operations until patches are applied. Implementing strict access controls to restrict who can manage hardware devices and perform hot-plug operations can reduce the risk of exploitation. Monitoring kernel logs for unusual messages related to zcrypt card allocations and frees may help detect attempts to trigger the vulnerability. Finally, organizations should maintain robust incident response plans tailored for mainframe environments to quickly address any exploitation attempts.
Affected Countries
Germany, United Kingdom, France, Netherlands, Italy, Spain, Switzerland
CVE-2024-26957: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: s390/zcrypt: fix reference counting on zcrypt card objects Tests with hot-plugging crytpo cards on KVM guests with debug kernel build revealed an use after free for the load field of the struct zcrypt_card. The reason was an incorrect reference handling of the zcrypt card object which could lead to a free of the zcrypt card object while it was still in use. This is an example of the slab message: kernel: 0x00000000885a7512-0x00000000885a7513 @offset=1298. First byte 0x68 instead of 0x6b kernel: Allocated in zcrypt_card_alloc+0x36/0x70 [zcrypt] age=18046 cpu=3 pid=43 kernel: kmalloc_trace+0x3f2/0x470 kernel: zcrypt_card_alloc+0x36/0x70 [zcrypt] kernel: zcrypt_cex4_card_probe+0x26/0x380 [zcrypt_cex4] kernel: ap_device_probe+0x15c/0x290 kernel: really_probe+0xd2/0x468 kernel: driver_probe_device+0x40/0xf0 kernel: __device_attach_driver+0xc0/0x140 kernel: bus_for_each_drv+0x8c/0xd0 kernel: __device_attach+0x114/0x198 kernel: bus_probe_device+0xb4/0xc8 kernel: device_add+0x4d2/0x6e0 kernel: ap_scan_adapter+0x3d0/0x7c0 kernel: ap_scan_bus+0x5a/0x3b0 kernel: ap_scan_bus_wq_callback+0x40/0x60 kernel: process_one_work+0x26e/0x620 kernel: worker_thread+0x21c/0x440 kernel: Freed in zcrypt_card_put+0x54/0x80 [zcrypt] age=9024 cpu=3 pid=43 kernel: kfree+0x37e/0x418 kernel: zcrypt_card_put+0x54/0x80 [zcrypt] kernel: ap_device_remove+0x4c/0xe0 kernel: device_release_driver_internal+0x1c4/0x270 kernel: bus_remove_device+0x100/0x188 kernel: device_del+0x164/0x3c0 kernel: device_unregister+0x30/0x90 kernel: ap_scan_adapter+0xc8/0x7c0 kernel: ap_scan_bus+0x5a/0x3b0 kernel: ap_scan_bus_wq_callback+0x40/0x60 kernel: process_one_work+0x26e/0x620 kernel: worker_thread+0x21c/0x440 kernel: kthread+0x150/0x168 kernel: __ret_from_fork+0x3c/0x58 kernel: ret_from_fork+0xa/0x30 kernel: Slab 0x00000372022169c0 objects=20 used=18 fp=0x00000000885a7c88 flags=0x3ffff00000000a00(workingset|slab|node=0|zone=1|lastcpupid=0x1ffff) kernel: Object 0x00000000885a74b8 @offset=1208 fp=0x00000000885a7c88 kernel: Redzone 00000000885a74b0: bb bb bb bb bb bb bb bb ........ kernel: Object 00000000885a74b8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74c8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74d8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74e8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a74f8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk kernel: Object 00000000885a7508: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 68 4b 6b 6b 6b a5 kkkkkkkkkkhKkkk. kernel: Redzone 00000000885a7518: bb bb bb bb bb bb bb bb ........ kernel: Padding 00000000885a756c: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZ kernel: CPU: 0 PID: 387 Comm: systemd-udevd Not tainted 6.8.0-HF #2 kernel: Hardware name: IBM 3931 A01 704 (KVM/Linux) kernel: Call Trace: kernel: [<00000000ca5ab5b8>] dump_stack_lvl+0x90/0x120 kernel: [<00000000c99d78bc>] check_bytes_and_report+0x114/0x140 kernel: [<00000000c99d53cc>] check_object+0x334/0x3f8 kernel: [<00000000c99d820c>] alloc_debug_processing+0xc4/0x1f8 kernel: [<00000000c99d852e>] get_partial_node.part.0+0x1ee/0x3e0 kernel: [<00000000c99d94ec>] ___slab_alloc+0xaf4/0x13c8 kernel: [<00000000c99d9e38>] __slab_alloc.constprop.0+0x78/0xb8 kernel: [<00000000c99dc8dc>] __kmalloc+0x434/0x590 kernel: [<00000000c9b4c0ce>] ext4_htree_store_dirent+0x4e/0x1c0 kernel: [<00000000c9b908a2>] htree_dirblock_to_tree+0x17a/0x3f0 kernel: ---truncated---
AI-Powered Analysis
Technical Analysis
CVE-2024-26957 is a use-after-free vulnerability identified in the Linux kernel's s390 architecture cryptographic subsystem, specifically within the zcrypt card object management. The vulnerability arises due to incorrect reference counting on zcrypt card objects, which are hardware cryptographic accelerator cards used primarily on IBM Z (s390) mainframe systems. During operations such as hot-plugging crypto cards in KVM guest environments with debug kernel builds, it was observed that the 'load' field of the struct zcrypt_card could be accessed after the object had been freed. This use-after-free condition results from improper handling of the reference count, leading to premature freeing of the zcrypt card object while it is still in use. The kernel logs and stack traces indicate that the allocation and freeing of these objects occur in functions like zcrypt_card_alloc and zcrypt_card_put, respectively. The flaw is categorized under CWE-416 (Use After Free), which can lead to undefined behavior including memory corruption, kernel crashes, or potentially arbitrary code execution if exploited. Although no known exploits are currently reported in the wild, the vulnerability affects Linux kernel versions containing the specified commit hashes and is relevant for systems utilizing the zcrypt subsystem, notably IBM Z mainframes running Linux. The vulnerability was discovered through rigorous testing involving hot-plugging cryptographic cards on KVM guests with debug kernels, highlighting a race condition or reference counting flaw in the kernel's device driver code for cryptographic hardware. The patch involves correcting the reference counting mechanism to ensure that zcrypt card objects are not freed while still in use, preventing use-after-free scenarios.
Potential Impact
For European organizations, the impact of CVE-2024-26957 is primarily relevant to those operating IBM Z mainframe systems running Linux, especially in environments that utilize hardware cryptographic accelerators for secure processing tasks. Such systems are often employed in critical sectors like banking, finance, government, and large enterprises where high-assurance cryptographic operations are essential. Exploitation of this vulnerability could lead to kernel crashes resulting in denial of service, or potentially allow an attacker with sufficient privileges to execute arbitrary code within the kernel context, compromising system confidentiality, integrity, and availability. Given the specialized nature of the affected subsystem and hardware, the threat surface is limited to organizations using s390 architecture Linux kernels with zcrypt cards. However, the criticality of these systems in processing sensitive data means that any compromise could have severe operational and reputational consequences. Additionally, the vulnerability could be leveraged in multi-tenant virtualized environments (KVM guests) to escalate privileges or disrupt services. The absence of known exploits reduces immediate risk, but the potential for exploitation in targeted attacks against high-value mainframe environments remains a concern.
Mitigation Recommendations
European organizations using IBM Z mainframes with Linux kernels should prioritize applying the official patches that correct the reference counting in the zcrypt card driver to eliminate the use-after-free condition. Since the vulnerability involves kernel-level code, updating to the latest stable Linux kernel versions containing the fix is essential. Organizations should also audit their systems to identify the presence of zcrypt hardware and assess whether their kernel versions are affected. In virtualized environments, particularly those using KVM guests with hot-pluggable crypto cards, additional caution should be exercised by limiting hot-plug operations until patches are applied. Implementing strict access controls to restrict who can manage hardware devices and perform hot-plug operations can reduce the risk of exploitation. Monitoring kernel logs for unusual messages related to zcrypt card allocations and frees may help detect attempts to trigger the vulnerability. Finally, organizations should maintain robust incident response plans tailored for mainframe environments to quickly address any exploitation attempts.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-02-19T14:20:24.200Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682cd0fa1484d88663aebfd2
Added to database: 5/20/2025, 6:59:06 PM
Last enriched: 7/4/2025, 5:26:18 PM
Last updated: 8/18/2025, 11:24:46 PM
Views: 13
Related Threats
CVE-2025-51529: n/a
MediumCVE-2025-50579: n/a
MediumCVE-2025-55740: CWE-1392: Use of Default Credentials in Anipaleja nginx-defender
MediumCVE-2025-51543: n/a
UnknownCVE-2025-50926: n/a
UnknownActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.