From da29c9dd7c6e3a03a1d6792178133e668fcd9604 Mon Sep 17 00:00:00 2001 From: Chaitanya Kulkarni Date: Wed, 21 Jul 2021 09:53:52 +0800 Subject: [PATCH] nvme-core: don't use NVME_NSID_ALL for command effects and supported log mainline inclusion from mainline-5.9-rc7 commit 46d2613eae51d527ecaf0e8248a9bfcc0b92aa7e category: bugfix bugzilla: 167363 CVE: NA --------------------------- In the function nvme_get_effects_log() it uses NVME_NSID_ALL which has namespace scope. The command effect log page is controller specific. Replace NVME_NSID_ALL with 0x00 which specifies the controller scope instead of namespace scope. Fixes: 84fef62d135b ("nvme: check admin passthru command effects") Link: https://bugzilla.kernel.org/show_bug.cgi?id=209287 Reported-by: Huai-Cheng Kuo Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Conflicts: drivers/nvme/host/core.c [ Feature commit be93e87e78025("nvme: support for multiple Command Sets Supported and Effects log pages") is not applied. ] Signed-off-by: Zhihao Cheng Reviewed-by: Hou Tao Signed-off-by: Yang Yingliang --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 880994fdc022..fc63ba2b4bb8 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2484,7 +2484,7 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl) if (!ctrl->effects) return 0; - ret = nvme_get_log(ctrl, NVME_NSID_ALL, NVME_LOG_CMD_EFFECTS, 0, + ret = nvme_get_log(ctrl, 0x00, NVME_LOG_CMD_EFFECTS, 0, ctrl->effects, sizeof(*ctrl->effects), 0); if (ret) { kfree(ctrl->effects); -- GitLab