From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hannes Reinecke <hare@suse.de>, Hannes Reinecke <hare@suse.com>,
Christoph Hellwig <hch@lst.de>, Sasha Levin <sashal@kernel.org>,
linux-nvme@lists.infradead.org
Subject: [PATCH AUTOSEL 4.19 16/28] nvme-multipath: zero out ANA log buffer
Date: Sat, 9 Feb 2019 13:48:24 -0500 [thread overview]
Message-ID: <20190209184840.126418-16-sashal@kernel.org> (raw)
In-Reply-To: <20190209184840.126418-1-sashal@kernel.org>
From: Hannes Reinecke <hare@suse.de>
[ Upstream commit c7055fd15ff46d92eb0dd1c16a4fe010d58224c8 ]
When nvme_init_identify() fails the ANA log buffer is deallocated
but _not_ set to NULL. This can cause double free oops when this
controller is deleted without ever being reconnected.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/multipath.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index c27af277e14e..815509dbed84 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -556,6 +556,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
return 0;
out_free_ana_log_buf:
kfree(ctrl->ana_log_buf);
+ ctrl->ana_log_buf = NULL;
out:
return error;
}
@@ -563,5 +564,6 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
void nvme_mpath_uninit(struct nvme_ctrl *ctrl)
{
kfree(ctrl->ana_log_buf);
+ ctrl->ana_log_buf = NULL;
}
--
2.19.1
next prev parent reply other threads:[~2019-02-09 18:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-09 18:48 [PATCH AUTOSEL 4.19 01/28] drm/amdgpu/sriov:Correct pfvf exchange logic Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 02/28] ACPI: NUMA: Use correct type for printing addresses on i386-PAE Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 03/28] perf report: Fix wrong iteration count in --branch-history Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 04/28] perf test shell: Use a fallback to get the pathname in vfs_getname Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 05/28] tools uapi: fix RISC-V 64-bit support Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 06/28] riscv: fix trace_sys_exit hook Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 07/28] cpufreq: check if policy is inactive early in __cpufreq_get() Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 08/28] drm/bridge: tc358767: add bus flags Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 09/28] drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 10/28] drm/bridge: tc358767: fix single lane configuration Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 11/28] drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 12/28] drm/bridge: tc358767: reject modes which require too much BW Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 13/28] drm/bridge: tc358767: fix output H/V syncs Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 14/28] nvme-pci: use the same attributes when freeing host_mem_desc_bufs Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 15/28] nvme-pci: fix out of bounds access in nvme_cqe_pending Sasha Levin
2019-02-09 18:48 ` Sasha Levin [this message]
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 17/28] nvme: pad fake subsys NQN vid and ssvid with zeros Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 18/28] drm/amdgpu: set WRITE_BURST_LENGTH to 64B to workaround SDMA1 hang Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 19/28] ARM: dts: da850-evm: Correct the audio codec regulators Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 20/28] ARM: dts: da850-evm: Correct the sound card name Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 21/28] ARM: dts: da850-lcdk: Correct the audio codec regulators Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 22/28] ARM: dts: da850-lcdk: Correct the sound card name Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 23/28] ARM: dts: kirkwood: Fix polarity of GPIO fan lines Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 24/28] gpio: pl061: handle failed allocations Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 25/28] drm/nouveau: Don't disable polling in fallback mode Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 26/28] drm/nouveau/falcon: avoid touching registers if engine is off Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 27/28] cifs: Limit memory used by lock request calls to a page Sasha Levin
2019-02-09 18:48 ` [PATCH AUTOSEL 4.19 28/28] kvm: sev: Fail KVM_SEV_INIT if already initialized Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190209184840.126418-16-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox