Re: LIO bug in REJECT pdu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2012-09-19 at 18:15 -0700, ronnie sahlberg wrote:
> Hi,
> 
> Doing some tests with my iscsi test tool I discovered that Wireshark
> does not decode LIO iSCSI REJECT PDUs.
> The reason is due to the sanity checking in wireshark deems the REJECT
> PDUs as "not iscsi" an thus it skips dissecting the packet.
> 
> I have attached a trivial trace where you can see this PDU in frame 7.
> Now, I could just change wireshark to be more forgiving and losen the
> sanity checks a little, but since LIO is open source
> it should be semi-easy to fix the actual bug instead of adding a
> workaround to wireshark.
> 
> The bug is that RFC3720 section 10.17 indicates that bytes 16 to 19
> should all be set to 0xff.
> But as you see in the trace above these bytes are set to 0x00 when
> sent from LIO.
> 

Nice catch!

> This is what trips up wireshark. Since these bytes are supposed to be
> 0xff for a REJECT PDU, this is thus deemed to be not-ISCSI and
> wireshark might try a different protocol dissector instead.
> 
> 
> Maybe someone could look at this and fix the REJECT PDU.
> 
> I use LIO as it shipped with Fedora 17.
> 

The following patch cut against v3.6-rc6 should fix this up.

Also adding your Reported-by w/ a CC to stable.

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 9cfdeed..30842e1 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -3427,6 +3427,7 @@ static int iscsit_send_reject(
        hdr->opcode             = ISCSI_OP_REJECT;
        hdr->flags              |= ISCSI_FLAG_CMD_FINAL;
        hton24(hdr->dlength, ISCSI_HDR_LEN);
+       hdr->ffffffff           = 0xffffffff;
        cmd->stat_sn            = conn->stat_sn++;
        hdr->statsn             = cpu_to_be32(cmd->stat_sn);
        hdr->exp_cmdsn  = cpu_to_be32(conn->sess->exp_cmd_sn);


Thanks alot Ronnie!

--nab

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux