Skip to content

Commit c58a252

Browse files
tangwenjiNicholas Bellinger
authored andcommitted
target: fix buffer offset in core_scsi3_pri_read_full_status
When at least two initiators register pr on the same LUN, the target returns the exception data due to buffer offset error, therefore the initiator executes command 'sg_persist -s' may cause the initiator to appear segfault error. This fixes a regression originally introduced by: commit a85d667 Author: Bart Van Assche <[email protected]> Date: Tue May 23 16:48:27 2017 -0700 target: Use {get,put}_unaligned_be*() instead of open coding these functions Signed-off-by: tangwenji <[email protected]> Cc: [email protected] # 4.13+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 88fb2fa commit c58a252

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/target/target_core_pr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4011,6 +4011,7 @@ core_scsi3_pri_read_full_status(struct se_cmd *cmd)
40114011
* Set the ADDITIONAL DESCRIPTOR LENGTH
40124012
*/
40134013
put_unaligned_be32(desc_len, &buf[off]);
4014+
off += 4;
40144015
/*
40154016
* Size of full desctipor header minus TransportID
40164017
* containing $FABRIC_MOD specific) initiator device/port

0 commit comments

Comments
 (0)