# CVE-2025-40125: blk-mq: check kobject state\_in\_sysfs before deleting in blk\_mq\_unregister\_hctx

- Priority: **Insufficient evidence**
- Reason: No CVSS vector published; no exploitation reported by the 5 checked sources
- Next step: Check the vendor advisory
- Status: published
- Published: 2025-11-12 · Modified: 2026-05-11
- Aliases: UBUNTU-CVE-2025-40125, DEBIAN-CVE-2025-40125
- Record: https://cvemate.com/vulnerability/CVE-2025-40125 · JSON: https://cvemate.com/vulnerability/CVE-2025-40125/json

## Description

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

blk-mq: check kobject state_in_sysfs before deleting in blk_mq_unregister_hctx

In __blk_mq_update_nr_hw_queues() the return value of
blk_mq_sysfs_register_hctxs() is not checked. If sysfs creation for hctx
fails, later changing the number of hw_queues or removing disk will
trigger the following warning:

  kernfs: can not remove 'nr_tags', no directory
  WARNING: CPU: 2 PID: 637 at fs/kernfs/dir.c:1707 kernfs_remove_by_name_ns+0x13f/0x160
  Call Trace:
   remove_files.isra.1+0x38/0xb0
   sysfs_remove_group+0x4d/0x100
   sysfs_remove_groups+0x31/0x60
   __kobject_del+0x23/0xf0
   kobject_del+0x17/0x40
   blk_mq_unregister_hctx+0x5d/0x80
   blk_mq_sysfs_unregister_hctxs+0x94/0xd0
   blk_mq_update_nr_hw_queues+0x124/0x760
   nullb_update_nr_hw_queues+0x71/0xf0 [null_blk]
   nullb_device_submit_queues_store+0x92/0x120 [null_blk]

kobjct_del() was called unconditionally even if sysfs creation failed.
Fix it by checkig the kobject creation statusbefore deleting it.
```

## Signals

- CVSS: none published
- EPSS: 0.227%, percentile 14.282%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 152)

- debian linux (Debian): \< 6.1.158-1 \| \< 6.12.57-1 \| \< 6.17.6-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-170.180 \| \< 6.8.0-106.106 \| \< 6.17.0-14.14
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1100.107 \| \< 6.8.0-1050.53 \| \< 6.17.0-1007.7
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1100.107~20.04.2
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.14 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.17 (Ubuntu): \< 6.17.0-1007.7~24.04.1
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1050.53~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1100.107+fips1 \| \< 6.8.0-1050.53+fips1
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1109.118 \| \< 6.8.0-1051.57 \| \< 6.17.0-1008.8
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 41)

- <https://git.kernel.org/stable/c/a8c53553f1833cc2d14175d2d72cf37193a01898>
- <https://git.kernel.org/stable/c/cc14ea21c4e658814d737ed4dedde6cd626a15ad>
- <https://git.kernel.org/stable/c/4b97e99b87a773d52699521d40864f3ec888e9a6>
- <https://git.kernel.org/stable/c/6e7dadc5763c48eb3b9b91265a21f312599ebb2c>
- <https://git.kernel.org/stable/c/06c4826b1d900611096e4621e93133db57e13911>
- <https://git.kernel.org/stable/c/babc634e9fe2803962dba98a07587e835dbc0731>
- <https://git.kernel.org/stable/c/d5ddd76ee52bdc16e9f8b1e7791291e785dab032>
- <https://git.kernel.org/stable/c/4c7ef92f6d4d08a27d676e4c348f4e2922cab3ed>
- <https://ubuntu.com/security/CVE-2025-40125>
- <https://www.cve.org/CVERecord?id=CVE-2025-40125>
- <https://git.kernel.org/linus/4c7ef92f6d4d08a27d676e4c348f4e2922cab3ed>
- <https://ubuntu.com/security/notices/USN-8029-1>
- <https://ubuntu.com/security/notices/USN-8030-1>
- <https://ubuntu.com/security/notices/USN-8033-1>
- <https://ubuntu.com/security/notices/USN-8033-2>
- <https://ubuntu.com/security/notices/USN-8033-3>
- <https://ubuntu.com/security/notices/USN-8034-1>
- <https://ubuntu.com/security/notices/USN-8033-4>
- <https://ubuntu.com/security/notices/USN-8029-2>
- <https://ubuntu.com/security/notices/USN-8033-5>

---

Data as of 2026-12-05T04:44:45.489Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
