Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933179AbbDQNdJ (ORCPT ); Fri, 17 Apr 2015 09:33:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33631 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933159AbbDQNdD (ORCPT ); Fri, 17 Apr 2015 09:33:03 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Christie , Nicholas Bellinger Subject: [PATCH 3.14 38/43] iscsi target: fix oops when adding reject pdu Date: Fri, 17 Apr 2015 15:29:12 +0200 Message-Id: <20150417132557.646387217@linuxfoundation.org> X-Mailer: git-send-email 2.3.5 In-Reply-To: <20150417132556.014766917@linuxfoundation.org> References: <20150417132556.014766917@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1615 Lines: 44 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mike Christie commit b815fc12d4dd2b5586184fb4f867caff05a810d4 upstream. This fixes a oops due to a double list add when adding a reject PDU for iscsit_allocate_iovecs allocation failures. The cmd has already been added to the conn_cmd_list in iscsit_setup_scsi_cmd, so this has us call iscsit_reject_cmd. Note that for ERL0 the reject PDU is not actually sent, so this patch is not completely tested. Just verified we do not oops. The problem is the add reject functions return -1 which is returned all the way up to iscsi_target_rx_thread which for ERL0 will drop the connection. Signed-off-by: Mike Christie Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/target/iscsi/iscsi_target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1165,7 +1165,7 @@ iscsit_handle_scsi_cmd(struct iscsi_conn * traditional iSCSI block I/O. */ if (iscsit_allocate_iovecs(cmd) < 0) { - return iscsit_add_reject_cmd(cmd, + return iscsit_reject_cmd(cmd, ISCSI_REASON_BOOKMARK_NO_RESOURCES, buf); } immed_data = cmd->immediate_data; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/