CVE-2023-52598 s390/ptrace: handle setting of fpc register correctly

High 7.1 Published Updated

A flaw in the Linux kernel s390 ptrace implementation allows register corruption, potentially enabling privilege escalation or code execution.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2023-52598?

CVE-2023-52598 is a high-severity memory corruption vulnerability in Linux kernel, published on 6 Mar 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

s390/ptrace: handle setting of fpc register correctly

If the content of the floating point control (fpc) register of a traced process is modified with the ptrace interface the new value is tested for validity by temporarily loading it into the fpc register.

This may lead to corruption of the fpc register of the tracing process: if an interrupt happens while the value is temporarily loaded into the fpc register, and within interrupt context floating point or vector registers are used, the current fp/vx registers are saved with save_fpu_regs() assuming they belong to user space and will be loaded into fp/vx registers when returning to user space.

test_fp_ctl() restores the original user space fpc register value, however it will be discarded, when returning to user space.

In result the tracer will incorrectly continue to run with the value that was supposed to be used for the traced process.

Fix this by saving fpu register contents with save_fpu_regs() before using test_fp_ctl().

Weakness: CWE-125

Which versions are affected by CVE-2023-52598?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2023-52598?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2023-52598 being exploited?

There is no known exploitation of CVE-2023-52598 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2023-52598, DEBIAN-CVE-2023-52598, GHSA-c4rp-h96r-7xm9, UBUNTU-CVE-2023-52598.

Is CVE-2023-52598 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free