<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/target/target_core_xcopy.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-09-15T03:41:24Z</updated>
<entry>
<title>scsi: target: Remove unused function arguments</title>
<updated>2021-09-15T03:41:24Z</updated>
<author>
<name>Li Feng</name>
</author>
<published>2021-09-13T08:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e642ca0375b95072ab6240c8eb9f0b4f013fb24'/>
<id>urn:sha1:7e642ca0375b95072ab6240c8eb9f0b4f013fb24</id>
<content type='text'>
The se_cmd is unused in these functions, just remove it.

Link: https://lore.kernel.org/r/20210913083045.3670648-1-fengli@smartx.com
Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Signed-off-by: Li Feng &lt;fengli@smartx.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: Fix sense key for invalid EXTENDED COPY request</title>
<updated>2021-08-18T02:28:40Z</updated>
<author>
<name>Sergey Samoylenko</name>
</author>
<published>2021-08-03T14:54:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0394b5048efd73b04276979d014a67f30c0ad699'/>
<id>urn:sha1:0394b5048efd73b04276979d014a67f30c0ad699</id>
<content type='text'>
TCM fails to pass the following tests in libiscsi:

  SCSI.ExtendedCopy.DescrType
  SCSI.ExtendedCopy.DescrLimits
  SCSI.ExtendedCopy.ParamHdr
  SCSI.ExtendedCopy.ValidSegDescr
  SCSI.ExtendedCopy.ValidTgtDescr

The xcopy code always returns the same NOT READY sense key for all detected
errors. Change the sense key for invalid requests to ILLEGAL REQUEST, and
for aborted transfers to COPY ABORTED.

Link: https://lore.kernel.org/r/20210803145410.80147-3-s.samoylenko@yadro.com
Fixes: d877d7275be3 ("target: Fix a deadlock between the XCOPY code and iSCSI session shutdown")
Reviewed-by: David Disseldorp &lt;ddiss@suse.de&gt;
Reviewed-by: Roman Bolshakov &lt;r.bolshakov@yadro.com&gt;
Reviewed-by: Konstantin Shelekhin &lt;k.shelekhin@yadro.com&gt;
Signed-off-by: Sergey Samoylenko &lt;s.samoylenko@yadro.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: Use standard SAM status types</title>
<updated>2021-06-01T02:48:24Z</updated>
<author>
<name>Hannes Reinecke</name>
</author>
<published>2021-04-27T08:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14b40c1e7ccc07e486719362f6f29ec5e3151331'/>
<id>urn:sha1:14b40c1e7ccc07e486719362f6f29ec5e3151331</id>
<content type='text'>
target_complete_cmd() and friends requires a SAM status type, so passing
GOOD here is actually wrong.

Link: https://lore.kernel.org/r/20210427083046.31620-40-hare@suse.de
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: core: Unify NAA identifier generation</title>
<updated>2021-05-15T18:14:28Z</updated>
<author>
<name>Sergey Samoylenko</name>
</author>
<published>2021-04-20T18:59:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=17f947b8b06f57615d31e4159dec1d5d7dda775f'/>
<id>urn:sha1:17f947b8b06f57615d31e4159dec1d5d7dda775f</id>
<content type='text'>
Both the INQUIRY handling and the XCOPY implementation provide functions to
generate an NAA designator. In addition, these functions are poorly named:

 - spc_parse_naa_6h_vendor_specific()
 - target_xcopy_gen_naa_ieee()

Introduce a common NAA 6 designator generation function,
spc_gen_naa_6h_vendor_specific().

Link: https://lore.kernel.org/r/20210420185920.42431-2-s.samoylenko@yadro.com
Signed-off-by: Sergey Samoylenko &lt;s.samoylenko@yadro.com&gt;
Signed-off-by: Roman Bolshakov &lt;r.bolshakov@yadro.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: core: Add gfp_t arg to target_cmd_init_cdb()</title>
<updated>2021-03-04T22:37:02Z</updated>
<author>
<name>Mike Christie</name>
</author>
<published>2021-02-27T16:59:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08694199477da412baf1852c6d1bf5fedbd40c7e'/>
<id>urn:sha1:08694199477da412baf1852c6d1bf5fedbd40c7e</id>
<content type='text'>
tcm_loop could be used like a normal block device, so we can't use
GFP_KERNEL and should use GFP_NOIO. This adds a gfp_t arg to
target_cmd_init_cdb() and converts the users. For every driver but loop
GFP_KERNEL is kept.

This will also be useful in subsequent patches where loop needs to do
target_submit_prep() from interrupt context to get a ref to the se_device,
and so it will need to use GFP_ATOMIC.

Link: https://lore.kernel.org/r/20210227170006.5077-16-michael.christie@oracle.com
Tested-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: core: Rename transport_init_se_cmd()</title>
<updated>2021-03-04T22:37:00Z</updated>
<author>
<name>Mike Christie</name>
</author>
<published>2021-02-27T16:59:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a78b713618c02752310b2be7da465a34fb660ed9'/>
<id>urn:sha1:a78b713618c02752310b2be7da465a34fb660ed9</id>
<content type='text'>
Rename transport_init_se_cmd() to __target_init_cmd() to reflect that it is
more of an internal function that drivers should normally not use and
because we are going to add a new init function in the next patches.

Link: https://lore.kernel.org/r/20210227170006.5077-4-michael.christie@oracle.com
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: Fix XCOPY NAA identifier lookup</title>
<updated>2021-01-11T22:06:48Z</updated>
<author>
<name>David Disseldorp</name>
</author>
<published>2020-11-03T01:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2896c93811e39d63a4d9b63ccf12a8fbc226e5e4'/>
<id>urn:sha1:2896c93811e39d63a4d9b63ccf12a8fbc226e5e4</id>
<content type='text'>
When attempting to match EXTENDED COPY CSCD descriptors with corresponding
se_devices, target_xcopy_locate_se_dev_e4() currently iterates over LIO's
global devices list which includes all configured backstores.

This change ensures that only initiator-accessible backstores are
considered during CSCD descriptor lookup, according to the session's
se_node_acl LUN list.

To avoid LUN removal race conditions, device pinning is changed from being
configfs based to instead using the se_node_acl lun_ref.

Reference: CVE-2020-28374
Fixes: cbf031f425fd ("target: Add support for EXTENDED_COPY copy offload emulation")
Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: David Disseldorp &lt;ddiss@suse.de&gt;
Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: Fix xcopy sess release leak</title>
<updated>2020-07-08T04:14:34Z</updated>
<author>
<name>Mike Christie</name>
</author>
<published>2020-07-02T01:43:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3c006c7d23aac928279f7cbe83bbac4361255d53'/>
<id>urn:sha1:3c006c7d23aac928279f7cbe83bbac4361255d53</id>
<content type='text'>
transport_init_session can allocate memory via percpu_ref_init, and
target_xcopy_release_pt never frees it. This adds a
transport_uninit_session function to handle cleanup of resources allocated
in the init function.

Link: https://lore.kernel.org/r/1593654203-12442-3-git-send-email-michael.christie@oracle.com
Signed-off-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: Rename target_setup_cmd_from_cdb() to target_cmd_parse_cdb()</title>
<updated>2020-06-10T01:57:26Z</updated>
<author>
<name>Sudhakar Panneerselvam</name>
</author>
<published>2020-06-07T19:58:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=987db58737e26c3d995811fefef9632756ca7cec'/>
<id>urn:sha1:987db58737e26c3d995811fefef9632756ca7cec</id>
<content type='text'>
This commit also removes the unused argument, cdb, that was passed to this
function.

Link: https://lore.kernel.org/r/1591559913-8388-5-git-send-email-sudhakar.panneerselvam@oracle.com
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Sudhakar Panneerselvam &lt;sudhakar.panneerselvam@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: target: Fix NULL pointer dereference</title>
<updated>2020-06-10T01:57:26Z</updated>
<author>
<name>Sudhakar Panneerselvam</name>
</author>
<published>2020-06-07T19:58:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e95fb805dc043cc8ed878a08d1583e4097a5f80'/>
<id>urn:sha1:9e95fb805dc043cc8ed878a08d1583e4097a5f80</id>
<content type='text'>
NULL pointer dereference happens when the following conditions are met:

1) A SCSI command is received for a non-existing LU or cdb initialization
   fails in target_setup_cmd_from_cdb().

2) Tracing is enabled.

The following call sequences lead to NULL pointer dereference:

1) iscsit_setup_scsi_cmd
     transport_lookup_cmd_lun &lt;-- lookup fails.
          or
     target_setup_cmd_from_cdb() &lt;-- cdb initialization fails
   iscsit_process_scsi_cmd
     iscsit_sequence_cmd
       transport_send_check_condition_and_sense
         trace_target_cmd_complete &lt;-- NULL dereference

2) target_submit_cmd_map_sgls
     transport_lookup_cmd_lun &lt;-- lookup fails
          or
     target_setup_cmd_from_cdb() &lt;-- cdb initialization fails
       transport_send_check_condition_and_sense
         trace_target_cmd_complete &lt;-- NULL dereference

In the above sequence, cmd-&gt;t_task_cdb is uninitialized which when
referenced in trace_target_cmd_complete() causes NULL pointer dereference.

The fix is to use the helper, target_cmd_init_cdb() and call it after
transport_init_se_cmd() is called, so that cmd-&gt;t_task_cdb can be
initialized and hence can be referenced in trace_target_cmd_complete().

Link: https://lore.kernel.org/r/1591559913-8388-4-git-send-email-sudhakar.panneerselvam@oracle.com
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Sudhakar Panneerselvam &lt;sudhakar.panneerselvam@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
