CVE-2025-38257

7.8 HIGH

📋 TL;DR

A vulnerability in the Linux kernel's s390/pkey subsystem allows integer overflow when calculating memory allocation size for APQN target lists. This can lead to heap memory corruption when userspace provides malicious input via ioctl calls. Systems running affected Linux kernel versions on s390 architecture are vulnerable.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not specified in CVE, but patches exist in stable kernel trees.
Operating Systems: Linux distributions running on s390/s390x architecture
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with s390 architecture and pkey subsystem enabled. Most x86/ARM systems are not affected.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel memory corruption leading to privilege escalation, denial of service, or arbitrary code execution in kernel context.

🟠

Likely Case

Kernel panic or system crash causing denial of service.

🟢

If Mitigated

Limited impact if proper access controls restrict ioctl calls to privileged users only.

🌐 Internet-Facing: LOW - Requires local access to the system.
🏢 Internal Only: MEDIUM - Local users or processes with ioctl access could exploit this vulnerability.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires local access and ability to make specific ioctl calls. The vulnerability was found through code analysis rather than active exploitation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Patches available in stable kernel trees (commits referenced in CVE)

Vendor Advisory: https://git.kernel.org/stable/c/73483ca7e07a5e39bdf612eec9d3d293e8bef649

Restart Required: Yes

Instructions:

1. Update to a patched Linux kernel version from your distribution vendor. 2. For custom kernels, apply the fix from the stable kernel tree. 3. Reboot the system after kernel update.

🔧 Temporary Workarounds

Restrict ioctl access

linux

Limit access to the vulnerable ioctl interface using SELinux, AppArmor, or capability restrictions.

# Example using capabilities: setcap -r /path/to/vulnerable-binary
# Use SELinux/AppArmor to restrict ioctl access to specific processes

🧯 If You Can't Patch

  • Implement strict access controls to prevent unprivileged users from making ioctl calls to the pkey subsystem.
  • Monitor system logs for kernel panics or unusual memory allocation patterns related to the pkey subsystem.

🔍 How to Verify

Check if Vulnerable:

Check kernel version and architecture: uname -r and uname -m. If s390/s390x architecture and kernel version is before the fix, system may be vulnerable.

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version is updated to a version containing the fix commits. Check with: grep -q 'pkey.*memdup_array_user' /proc/kallsyms 2>/dev/null && echo 'Patched' || echo 'Possibly vulnerable'

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic messages
  • OOM killer activity related to pkey subsystem
  • System crashes or unexpected reboots

Network Indicators:

  • Not applicable - local vulnerability

SIEM Query:

source="kernel" AND ("panic" OR "Oops" OR "BUG") AND "pkey"

🔗 References

📤 Share & Export