Skip to content

Commit a411ac1

Browse files
CIQ Kernel AutomationPlaidCat
authored andcommitted
nvme: avoid double free special payload
jira VULN-44150 cve CVE-2024-41073 commit-author Chunguang Xu <chunguang.xu@shopee.com> commit e5d574a If a discard request needs to be retried, and that retry may fail before a new special payload is added, a double free will result. Clear the RQF_SPECIAL_LOAD when the request is cleaned. Signed-off-by: Chunguang Xu <chunguang.xu@shopee.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com> Signed-off-by: Keith Busch <kbusch@kernel.org> (cherry picked from commit e5d574a) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent e9dfc2e commit a411ac1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/nvme/host/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ void nvme_cleanup_cmd(struct request *req)
959959
clear_bit_unlock(0, &ctrl->discard_page_busy);
960960
else
961961
kfree(bvec_virt(&req->special_vec));
962+
req->rq_flags &= ~RQF_SPECIAL_PAYLOAD;
962963
}
963964
}
964965
EXPORT_SYMBOL_GPL(nvme_cleanup_cmd);

0 commit comments

Comments
 (0)