Skip to contentSkip to conversation

Patch "scsi: csiostor: fix use after free in csio_hw_use_fwconfig()" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Apr 9, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

scsi: csiostor: fix use after free in csio_hw_use_fwconfig()

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
scsi-csiostor-fix-use-after-free-in-csio_hw_use_fwconfig.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Apr 9 17:09:24 CEST 2018

From: Varun Prakash <[email protected]>
Date: Wed, 17 May 2017 20:30:43 +0530
Subject: scsi: csiostor: fix use after free in csio_hw_use_fwconfig()

From: Varun Prakash <[email protected]>

[ Upstream commit a351e40b6de550049423a26f7ded7b639e363d89 ]

mbp pointer is passed to csio_hw_validate_caps() so call mempool_free() after calling csio_hw_validate_caps().

Fixes 541c571fa2fd ("csiostor:Use firmware version from cxgb4/t4fw_version.h")
---
 drivers/scsi/csiostor/csio_hw.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/scsi/csiostor/csio_hw.c +4 -1
@@ -1769,7 +1769,6 @@ csio_hw_use_fwconfig(struct csio_hw *hw,
 		goto bye;
 	}
 
-	mempool_free(mbp, hw->mb_mempool);
 	if (finicsum != cfcsum) {
 		csio_warn(hw,
 		      "Config File checksum mismatch: csum=%#x, computed=%#x\n",
@@ -1780,6 +1779,10 @@ csio_hw_use_fwconfig(struct csio_hw *hw,
 	rv = csio_hw_validate_caps(hw, mbp);
 	if (rv != 0)
 		goto bye;
+
+	mempool_free(mbp, hw->mb_mempool);
+	mbp = NULL;
+
 	/*
 	 * Note that we're operating with parameters
 	 * not supplied by the driver, rather than from hard-wired

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/scsi-csiostor-fix-use-after-free-in-csio_hw_use_fwconfig.patch