CVE-2024-41079: nvmet: always initialize cqe.result
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
nvmet: always initialize cqe.result
The spec doesn't mandate that the first two double words (aka results) for the command queue entry need to be set to 0 when they are not used (not specified). Though, the target implemention returns 0 for TCP and FC but not for RDMA.
Let's make RDMA behave the same and thus explicitly initializing the result field. This prevents leaking any data from the stack.
The Linux kernel CVE team has assigned CVE-2024-41079 to this issue.
Affected and fixed versions
===========================
Fixed in 6.1.101 with commit 30d35b24b795 Fixed in 6.6.42 with commit 10967873b807 Fixed in 6.9.11 with commit 0990e8a86364 Fixed in 6.10 with commit cd0c1b8e045a
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2024-41079
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/nvme/target/core.c
drivers/nvme/target/fabrics-cmd-auth.c
drivers/nvme/target/fabrics-cmd.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/30d35b24b7957922f81cfdaa66f2e1b1e9b9aed2 https://git.kernel.org/stable/c/10967873b80742261527a071954be8b54f0f8e4d https://git.kernel.org/stable/c/0990e8a863645496b9e3f91cfcfd63cd95c80319 https://git.kernel.org/stable/c/cd0c1b8e045a8d2785342b385cb2684d9b48e426