SCSI fixes for 4.19-rc3
Subsystems (3)
James Bottomley
maintainerA couple of small but important fixes, one affecting big endian and the other fixing a BUG_ON in scatterlist processing.
The patch is available here:
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes
The short changelog is:
Dan Carpenter (1):
scsi: qla2xxx: Fix an endian bug in fcpcmd_is_corrupted()
Laura Abbott (1):
scsi: iscsi: target: Don't use stack buffer for scatterlist
And the diffstat:
drivers/scsi/qla2xxx/qla_target.h | 4 ++-- drivers/target/iscsi/iscsi_target.c | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-)
With full diff below.
James
---
drivers/scsi/qla2xxx/qla_target.h +2 -2
@@ -374,8 +374,8 @@ struct atio_from_isp {static inline int fcpcmd_is_corrupted (struct atio *atio) {if (atio->entry_type ==ATIO_TYPE7 && - (le16_to_cpu (atio->attr_n_length &FCP_CMD_LENGTH_MASK ) < -FCP_CMD_LENGTH_MIN )) + ((le16_to_cpu (atio->attr_n_length) &FCP_CMD_LENGTH_MASK ) < +FCP_CMD_LENGTH_MIN ))return 1 ;else return 0 ;
drivers/target/iscsi/iscsi_target.c +14 -8
@@ -1416,7 +1416,8 @@ static void iscsit_do_crypto_hash_buf(struct ahash_request *hash,sg_init_table (sg,ARRAY_SIZE (sg));sg_set_buf (sg, buf, payload_length); -sg_set_buf (sg +1 , pad_bytes, padding); +if (padding) +sg_set_buf (sg +1 , pad_bytes, padding);ahash_request_set_crypt (hash, sg, data_crc, payload_length + padding);
@@ -3910,10 +3911,14 @@ static bool iscsi_target_check_conn_state(struct iscsi_conn *conn)static void iscsit_get_rx_pdu (struct iscsi_conn *conn) {int ret; -u8 buffer[ISCSI_HDR_LEN ], opcode; +u8 *buffer, opcode;u32 checksum =0 , digest =0 ;struct kvec iov; + buffer =kcalloc (ISCSI_HDR_LEN ,sizeof (*buffer),GFP_KERNEL ); +if (!buffer) +return ; +while (!kthread_should_stop ()) {/* * Ensure that both TX and RX per connection kthreads
@@ -3921,7 +3926,6 @@ static void iscsit_get_rx_pdu(struct iscsi_conn *conn)*/ iscsit_thread_check_cpumask (conn, current,0 ); -memset (buffer,0 ,ISCSI_HDR_LEN );memset (&iov,0 ,sizeof (struct kvec )); iov.iov_base = buffer;
@@ -3930,7 +3934,7 @@ static void iscsit_get_rx_pdu(struct iscsi_conn *conn) ret =rx_data (conn, &iov,1 ,ISCSI_HDR_LEN );if (ret !=ISCSI_HDR_LEN ) {iscsit_rx_thread_wait_for_tcp (conn); -return ; +break ; }if (conn->conn_ops->HeaderDigest) {
@@ -3940,7 +3944,7 @@ static void iscsit_get_rx_pdu(struct iscsi_conn *conn) ret =rx_data (conn, &iov,1 ,ISCSI_CRC_LEN );if (ret !=ISCSI_CRC_LEN ) {iscsit_rx_thread_wait_for_tcp (conn); -return ; +break ; } iscsit_do_crypto_hash_buf(conn->conn_rx_hash, buffer,
@@ -3964,7 +3968,7 @@ static void iscsit_get_rx_pdu(struct iscsi_conn *conn) }if (conn->conn_state ==TARG_CONN_STATE_IN_LOGOUT ) -return ; +break ; opcode = buffer[0 ] &ISCSI_OPCODE_MASK ;
@@ -3975,13 +3979,15 @@ static void iscsit_get_rx_pdu(struct iscsi_conn *conn) " while in Discovery Session, rejecting.\n", opcode);iscsit_add_reject (conn,ISCSI_REASON_PROTOCOL_ERROR , buffer); -return ; +break ; } ret =iscsi_target_rx_opcode (conn, buffer);if (ret <0 ) -return ; +break ; } + +kfree (buffer); }int iscsi_target_rx_thread (void *arg)
Quoted 6 lines · James Bottomley
A couple of small but important fixes, one affecting big endian and the other fixing a
BUG_ONin scatterlist processing.The patch is available here:
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.gitscsi-fixes
Now pulled, thanks.
greg k-h