nvmet-auth: validate reply message payload bounds against transfer length
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ db1312dd95488b5e6ff362ff66fcf953a46b1821 · < 3a413ece2504c70aa34a20be4dafec04e8c741f9| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nvmet-auth: validate reply message payload bounds against transfer length
nvmet_auth_reply() accesses the variable-length rval[] array using attacker-controlled hl (hash length) and dhvlen (DH value length) fields without verifying they fit within the allocated buffer of tl bytes.
A malicious NVMe-oF initiator can craft a DHCHAP_REPLY message with a small transfer length but large hl/dhvlen values, causing out-of-bounds heap reads when the target processes the DH public key (rval + 2*hl) or performs the host response memcmp.
With DH authentication configured, the OOB pointer is passed directly to sg_init_one() and read by crypto_kpp_compute_shared_secret(), reaching up to 526 bytes past the buffer. This is exploitable pre-authentication.
Add bounds validation ensuring sizeof(*data) + 2*hl + dhvlen <= tl before any access to the variable-length fields.
Discovered by Atuin - Automated Vulnerability Discovery Engine.
From the CVE record · Linux
The Linux kernel's nvmet-auth code does not check whether lengths in a DHCHAP_REPLY message fit within the transfer buffer. A malicious NVMe-oF initiator can trigger out-of-bounds heap reads on a target with DH authentication configured, before authentication and without user interaction.
Operators of Linux kernel NVMe-oF targets with DH authentication configured should check whether their kernel is affected; affected versions were not specified.