OSDN Git Service

scsi: target: Fix iscsi transport id buffer setup
authorMike Christie <michael.christie@oracle.com>
Thu, 2 Jul 2020 01:43:21 +0000 (20:43 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 8 Jul 2020 04:14:34 +0000 (00:14 -0400)
commita6f9b6cee3f25fdf08953553a468e658fed00f3c
treeef870d63af5b5a53063befa547e384fd766df59e
parent169622eee4373d98172647a1efad24e8fcd94e1b
scsi: target: Fix iscsi transport id buffer setup

This fixes the following bugs with the transport id setup for iscsi:

 1. Incorrectly adding NULL after initiator name for TPID format 1.

 2. For TPID format 1 buffer setup we are doing off+len, off++ and then
    also len+=some_value. This results in the isid going past buffer
    boundaries when we then do buf[off+len]

 3. The pr_reg_isid is the isid in string format which is 12 bytes, but we
    are only copying 6 bytes.

Link: https://lore.kernel.org/r/1593654203-12442-6-git-send-email-michael.christie@oracle.com
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_fabric_lib.c