CVE-2025-37952 ksmbd: Fix UAF in __close_file_table_ids

High 8.8 Published Updated

A use-after-free in the Linux kernel's ksmbd module allows attackers to potentially execute code or escalate privileges via race conditions.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-37952?

CVE-2025-37952 is a high-severity use after free vulnerability in Linux kernel, published on 20 May 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

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

ksmbd: Fix UAF in __close_file_table_ids

A use-after-free is possible if one thread destroys the file via __ksmbd_close_fd while another thread holds a reference to it. The existing checks on fp->refcount are not sufficient to prevent this.

The fix takes ft->lock around the section which removes the file from the file table. This prevents two threads acquiring the same file pointer via __close_file_table_ids, as well as the other functions which retrieve a file from the IDR and which already use this same lock.

Weakness: CWE-416

Which versions are affected by CVE-2025-37952?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2025-37952?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-37952 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2025-37952, DEBIAN-CVE-2025-37952, GHSA-5m2x-9h8v-h39x, ROOT-OS-DEBIAN-12-CVE-2025-37952, ROOT-OS-UBUNTU-2204-CVE-2025-37952, ROOT-OS-UBUNTU-2404-CVE-2025-37952 and 1 more.

Is CVE-2025-37952 in your software?

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

Check your SBOMs for free