Skip to contentSkip to conversation

Patch "scsi: libsas: fix memory leak in sas_smp_get_phy_events()" has been added to the 4.4-stable tree

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

Subsystems (3)
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: libsas: fix memory leak in sas_smp_get_phy_events()

to the 4.4-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-libsas-fix-memory-leak-in-sas_smp_get_phy_events.patch
and it can be found in the queue-4.4 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 Tue Apr 10 10:31:53 CEST 2018

From: Jason Yan <[email protected]>
Date: Thu, 4 Jan 2018 21:04:31 +0800
Subject: scsi: libsas: fix memory leak in sas_smp_get_phy_events()

From: Jason Yan <[email protected]>

[ Upstream commit 4a491b1ab11ca0556d2fda1ff1301e862a2d44c4 ]

We've got a memory leak with the following producer:

while true;
do cat /sys/class/sas_phy/phy-1:0:12/invalid_dword_count >/dev/null; done

The buffer req is allocated and not freed after we return. Fix it.

---
 drivers/scsi/libsas/sas_expander.c |    1 +
 1 file changed, 1 insertion(+)
drivers/scsi/libsas/sas_expander.c +1 -0
@@ -684,6 +684,7 @@ int sas_smp_get_phy_events(struct sas_ph
 	phy->phy_reset_problem_count = scsi_to_u32(&resp[24]);
 
  out:
+	kfree(req);
 	kfree(resp);
 	return res;
 

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

queue-4.4/scsi-libsas-initialize-sas_phy-status-according-to-response-of-discover.patch queue-4.4/scsi-libsas-fix-error-when-getting-phy-events.patch queue-4.4/scsi-libsas-fix-memory-leak-in-sas_smp_get_phy_events.patch