nvmet: fix NULL pointer dereference in nvmet_execute_identify_ns_zns()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ aaf2e048af2704da5869f27b508b288f36d5c7b7 · < 0b4cf43f9ca7118590a338de900edbd6047cd89f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nvmet: fix NULL pointer dereference in nvmet_execute_identify_ns_zns()
When a host issues an Identify command with CNS 05h (I/O Command Set specific Identify Namespace) and CSI 02h (ZNS) targeting a file-backed namespace, nvmet_execute_identify_ns_zns() calls bdev_is_zoned() on req->ns->bdev. A file-backed namespace has no block device, so req->ns->bdev is NULL and bdev_is_zoned() dereferences it, oopsing.
The I/O command set is selected by the host-supplied CSI field and the command is routed here whenever CONFIG_BLK_DEV_ZONED is enabled, independent of the namespace backing type, so any file-backed namespace is exposed.
Reject the command with Invalid Field when the namespace is not backed by a block device.
From the CVE record · Linux
The Linux kernel’s nvmet code can dereference a NULL pointer when a host sends a ZNS Identify Namespace command to a file-backed namespace. This can cause a kernel oops when CONFIG_BLK_DEV_ZONED is enabled. The input does not specify whether authentication is required.
Operators of Linux kernel NVMe targets with CONFIG_BLK_DEV_ZONED enabled and file-backed namespaces should check their installations; affected versions are not specified.