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

    iscsi-target: Fix potential NULL pointer in solicited NOPOUT reject

to the 3.10-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:
     iscsi-target-fix-potential-null-pointer-in-solicited-nopout-reject.patch
and it can be found in the queue-3.10 subdirectory.

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


>From 28aaa950320fc7b8df3f6d2d34fa7833391a9b72 Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <[email protected]>
Date: Fri, 23 Aug 2013 22:28:56 -0700
Subject: iscsi-target: Fix potential NULL pointer in solicited NOPOUT reject

From: Nicholas Bellinger <[email protected]>

commit 28aaa950320fc7b8df3f6d2d34fa7833391a9b72 upstream.

This patch addresses a potential NULL pointer dereference regression in
iscsit_setup_nop_out() code, specifically for two cases when a solicited
NOPOUT triggers a ISCSI_REASON_PROTOCOL_ERROR reject to be generated.

This is because iscsi_cmd is expected to be NULL for solicited NOPOUT
case before iscsit_process_nop_out() locates the descriptor via TTT
using iscsit_find_cmd_from_ttt().

This regression was originally introduced in:

commit ba159914086f06532079fc15141f46ffe7e04a41
Author: Nicholas Bellinger <[email protected]>
Date:   Wed Jul 3 03:48:24 2013 -0700

    iscsi-target: Fix iscsit_add_reject* usage for iser

Signed-off-by: Nicholas Bellinger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/target/iscsi/iscsi_target.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1536,6 +1536,10 @@ int iscsit_handle_nop_out(struct iscsi_c
        if (hdr->itt == RESERVED_ITT && !(hdr->opcode & ISCSI_OP_IMMEDIATE)) {
                pr_err("NOPOUT ITT is reserved, but Immediate Bit is"
                        " not set, protocol error.\n");
+               if (!cmd)
+                       return iscsit_add_reject(conn, 
ISCSI_REASON_PROTOCOL_ERROR,
+                                                (unsigned char *)hdr);
+
                return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR,
                                         (unsigned char *)hdr);
        }
@@ -1545,6 +1549,10 @@ int iscsit_handle_nop_out(struct iscsi_c
                        " greater than MaxXmitDataSegmentLength: %u, protocol"
                        " error.\n", payload_length,
                        conn->conn_ops->MaxXmitDataSegmentLength);
+               if (!cmd)
+                       return iscsit_add_reject(conn, 
ISCSI_REASON_PROTOCOL_ERROR,
+                                                (unsigned char *)hdr);
+
                return iscsit_reject_cmd(cmd, ISCSI_REASON_PROTOCOL_ERROR,
                                         (unsigned char *)hdr);
        }


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

queue-3.10/target-fix-trailing-ascii-space-usage-in-inquiry-vendor-model.patch
queue-3.10/iscsi-target-fix-iscsit_transport-reference-leak-during-np-thread-reset.patch
queue-3.10/iscsi-target-fix-immediatedata-yes-failure-regression-in-v3.10.patch
queue-3.10/iscsi-target-fix-potential-null-pointer-in-solicited-nopout-reject.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

Reply via email to