Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2025-21731

HIGH 7.8EPSS 20%

nbd: don't allow reconnect after disconnect

Mitigation

  • Upgrade Linux to 844b8cdc681612ff24df62cdefddeab5772fadf1 or later.

Who should check

  • Anyone running Linux >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e70a578487a47d7cf058904141e586684d1c3381; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 6bef6222a3f6c7adb6396f77f25a3579d821b09a; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e3be8862d73cac833e0fb7602636c19c6cb94b11; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e7343fa33751cb07c1c56b666bf37cfca357130e; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < d208d2c52b652913b5eefc8ca434b0d6b757f68f; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < a8ee6ecde2b7bfb58c8a3afe8a9d2b848f580739; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 9793bd5ae4bdbdb2dde401a3cab94a6bfd05e302; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 844b8cdc681612ff24df62cdefddeab5772fadf1
  • Anyone running Linux 4.12

Vulnerability facts

Affected
Linux >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e70a578487a47d7cf058904141e586684d1c3381; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 6bef6222a3f6c7adb6396f77f25a3579d821b09a; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e3be8862d73cac833e0fb7602636c19c6cb94b11; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e7343fa33751cb07c1c56b666bf37cfca357130e; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < d208d2c52b652913b5eefc8ca434b0d6b757f68f; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < a8ee6ecde2b7bfb58c8a3afe8a9d2b848f580739; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 9793bd5ae4bdbdb2dde401a3cab94a6bfd05e302; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 844b8cdc681612ff24df62cdefddeab5772fadf1; Linux 4.12
Fixed in
Linux 6bef6222a3f6c7adb6396f77f25a3579d821b09a, Linux 9793bd5ae4bdbdb2dde401a3cab94a6bfd05e302, Linux 844b8cdc681612ff24df62cdefddeab5772fadf1
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Not remotely exploitable (local or adjacent access needed)
CVSS
7.8 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Local
  • Attack complexity: Low
  • Privileges required: Low
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: High
EPSS
0.34% chance of exploitation in 30 days (percentile 20, 2026-11-26)
CWE
CWE-416
Published
Modified

Description

In the Linux kernel, the following vulnerability has been resolved: nbd: don't allow reconnect after disconnect Following process can cause nbd_config UAF: 1) grab nbd_config temporarily; 2) nbd_genl_disconnect() flush all recv_work() and release the initial reference: nbd_genl_disconnect nbd_disconnect_and_put nbd_disconnect flush_workqueue(nbd->recv_workq) if (test_and_clear_bit(NBD_RT_HAS_CONFIG_REF, ...)) nbd_config_put -> due to step 1), reference is still not zero 3) nbd_genl_reconfigure() queue recv_work() again; nbd_genl_reconfigure config = nbd_get_config_unlocked(nbd) if (!config) -> succeed if (!test_bit(NBD_RT_BOUND, ...)) -> succeed nbd_reconnect_socket queue_work(nbd->recv_workq, &args->work) 4) step 1) release the reference; 5) Finially, recv_work() will trigger UAF: recv_work nbd_config_put(nbd) -> nbd_config is freed atomic_dec(&config->recv_threads) -> UAF Fix the problem by clearing NBD_RT_BOUND in nbd_genl_disconnect(), so that nbd_genl_reconfigure() will fail.

Affected and fixed versions

Package / productAffectedFixedSource
Linux>= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e70a578487a47d7cf058904141e586684d1c3381; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 6bef6222a3f6c7adb6396f77f25a3579d821b09a; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e3be8862d73cac833e0fb7602636c19c6cb94b11; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e7343fa33751cb07c1c56b666bf37cfca357130e; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < d208d2c52b652913b5eefc8ca434b0d6b757f68f; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < a8ee6ecde2b7bfb58c8a3afe8a9d2b848f580739; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 9793bd5ae4bdbdb2dde401a3cab94a6bfd05e302; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 844b8cdc681612ff24df62cdefddeab5772fadf1—cvelist
Linux4.12—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2025-21731. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21731.md
Affected: Linux >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e70a578487a47d7cf058904141e586684d1c3381; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 6bef6222a3f6c7adb6396f77f25a3579d821b09a; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e3be8862d73cac833e0fb7602636c19c6cb94b11; >= b7aa3d39385dc2d95899f9e…
Fixed in: Linux 6bef6222a3f6c7adb6396f77f25a3579d821b09a, Linux 9793bd5ae4bdbdb2dde401a3cab94a6bfd05e302, Linux 844b8cdc681612ff24df62cdefddeab5772fadf1

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2025-21731 being exploited?

There is no confirmed exploitation: CVE-2025-21731 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2025-21731?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

Which versions are affected by CVE-2025-21731?

Linux >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e70a578487a47d7cf058904141e586684d1c3381; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 6bef6222a3f6c7adb6396f77f25a3579d821b09a; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e3be8862d73cac833e0fb7602636c19c6cb94b11; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < e7343fa33751cb07c1c56b666bf37cfca357130e; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < d208d2c52b652913b5eefc8ca434b0d6b757f68f; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < a8ee6ecde2b7bfb58c8a3afe8a9d2b848f580739; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 9793bd5ae4bdbdb2dde401a3cab94a6bfd05e302; >= b7aa3d39385dc2d95899f9e379623fef446a2acd, < 844b8cdc681612ff24df62cdefddeab5772fadf1; Linux 4.12.

Is there a fix for CVE-2025-21731?

Yes. Fixed in Linux 6bef6222a3f6c7adb6396f77f25a3579d821b09a, Linux 9793bd5ae4bdbdb2dde401a3cab94a6bfd05e302, Linux 844b8cdc681612ff24df62cdefddeab5772fadf1. Upgrade Linux to 844b8cdc681612ff24df62cdefddeab5772fadf1 or later.

How do I check if I'm affected by CVE-2025-21731?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors