This is a note to let you know that I've just added the patch titled
tcm_fc: Fix fc_exch memory leak in ft_send_resp_status
to the 3.3-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:
tcm_fc-fix-fc_exch-memory-leak-in-ft_send_resp_status.patch
and it can be found in the queue-3.3 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 031ed4d565b31880a4136bb7366bc89f5b1dba7d Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <[email protected]>
Date: Fri, 9 Mar 2012 23:45:38 -0800
Subject: tcm_fc: Fix fc_exch memory leak in ft_send_resp_status
From: Nicholas Bellinger <[email protected]>
commit 031ed4d565b31880a4136bb7366bc89f5b1dba7d upstream.
This patch fixes a bug in tcm_fc where fc_exch memory from fc_exch_mgr->ep_pool
is currently being leaked by ft_send_resp_status() usage. Following current
code in ft_queue_status() response path, using lport->tt.seq_send() needs to be
followed by a lport->tt.exch_done() in order to release fc_exch memory back into
libfc_em kmem_cache.
ft_send_resp_status() code is currently used in pre submit se_cmd ft_send_work()
error exceptions, TM request setup exceptions, and main TM response callback
path in ft_queue_tm_resp(). This bugfix addresses the leak in these cases.
Cc: Mark D Rustad <[email protected]>
Cc: Kiran Patil <[email protected]>
Cc: Robert Love <[email protected]>
Cc: Andy Grover <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/target/tcm_fc/tfc_cmd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -325,10 +325,12 @@ static void ft_send_resp_status(struct f
fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0);
sp = fr_seq(fp);
- if (sp)
+ if (sp) {
lport->tt.seq_send(lport, sp, fp);
- else
+ lport->tt.exch_done(sp);
+ } else {
lport->tt.frame_send(lport, fp);
+ }
}
/*
Patches currently in stable-queue which might be from [email protected] are
queue-3.3/iscsi-target-fix-dynamic-explict-nodeacl-pointer-reference.patch
queue-3.3/target-don-t-set-wbus16-or-sync-bits-in-inquiry-response.patch
queue-3.3/target-fix-use-after-free-in-target_report_luns.patch
queue-3.3/target-fix-16-bit-target-ports-for-set-target-port-groups-emulation.patch
queue-3.3/target-prevent-null-pointer-dereference-in-target_report_luns.patch
queue-3.3/tcm_fc-fix-fc_exch-memory-leak-in-ft_send_resp_status.patch
queue-3.3/tcm_loop-set-residual-field-for-scsi-commands.patch
queue-3.3/target-set-peripheral-device-type-consistently-in-inquiry-response.patch
queue-3.3/target-fix-up-handling-of-short-inquiry-buffers.patch
queue-3.3/iscsi-target-fix-iscsit_alloc_buffs-failure-cases.patch
queue-3.3/ib_srpt-fix-srpt_handle_cmd-send_ioctx-ioctx_kref-leak-on-exception.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html