<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/target/iscsi, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi</title>
<updated>2026-11-18T19:21:30+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-11-18T19:21:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=27e694b84eca6c7fa0878662764567a3cc396fc2'/>
<id>27e694b84eca6c7fa0878662764567a3cc396fc2</id>
<content type='text'>
Pull SCSI fixes from James Bottomley:
 "Mostly driver fixes. The only core one is the bsg one to prevent
  copying of sense data after the task is cancelled (which could result
  in random memory writes from the kernel). ufs has the largest set of
  fixes, but they're also fairly mundane"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (21 commits)
  scsi: mpi3mr: Validate reply frame size bounds
  scsi: target: core: Parse APTPL res_type and res_scope as hex
  scsi: target: iscsi: Check for existing sessions only after authentication
  scsi: sd_zbc: Cap zone report count by buffer size
  scsi: rdac: Keep the error status when controller lookup fails
  scsi: target: Fix NULL pointer dereference in core_alua_do_port_transition()
  scsi: target: Fix NULL pointer dereference in target_dev_alua_lu_gp_store()
  scsi: ufs: qcom: Reprogram ESI after a host controller reset
  scsi: ufs: mcq: Poll OCS after sq cleanup for device management commands
  scsi: ufs: core: Skip ABORT TASK for device management commands
  scsi: leapraid: Fix init_cmd_priv error handling
  scsi: ufs: rockchip: Improve RX noise immunity
  scsi: ufs: hwmon, debugfs: Propagate runtime PM resume errors
  scsi: ufs: bsg: Abort ufs_bsg_request() when runtime resume fails
  scsi: ufs: sysfs: Propagate runtime PM resume errors
  scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper
  scsi: ufs: core: Restore jiffies conversion of device management timeouts
  scsi: target: iscsi: Fix hanging WRITE_PENDING commands
  scsi: Revert "scsi: target: iscsi: Fix hang for aborted WRITE_PENDING commands"
  scsi: ufs: core: Keep clock-gating hold on failed W-LUN runtime resume
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull SCSI fixes from James Bottomley:
 "Mostly driver fixes. The only core one is the bsg one to prevent
  copying of sense data after the task is cancelled (which could result
  in random memory writes from the kernel). ufs has the largest set of
  fixes, but they're also fairly mundane"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (21 commits)
  scsi: mpi3mr: Validate reply frame size bounds
  scsi: target: core: Parse APTPL res_type and res_scope as hex
  scsi: target: iscsi: Check for existing sessions only after authentication
  scsi: sd_zbc: Cap zone report count by buffer size
  scsi: rdac: Keep the error status when controller lookup fails
  scsi: target: Fix NULL pointer dereference in core_alua_do_port_transition()
  scsi: target: Fix NULL pointer dereference in target_dev_alua_lu_gp_store()
  scsi: ufs: qcom: Reprogram ESI after a host controller reset
  scsi: ufs: mcq: Poll OCS after sq cleanup for device management commands
  scsi: ufs: core: Skip ABORT TASK for device management commands
  scsi: leapraid: Fix init_cmd_priv error handling
  scsi: ufs: rockchip: Improve RX noise immunity
  scsi: ufs: hwmon, debugfs: Propagate runtime PM resume errors
  scsi: ufs: bsg: Abort ufs_bsg_request() when runtime resume fails
  scsi: ufs: sysfs: Propagate runtime PM resume errors
  scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper
  scsi: ufs: core: Restore jiffies conversion of device management timeouts
  scsi: target: iscsi: Fix hanging WRITE_PENDING commands
  scsi: Revert "scsi: target: iscsi: Fix hang for aborted WRITE_PENDING commands"
  scsi: ufs: core: Keep clock-gating hold on failed W-LUN runtime resume
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: target: iscsi: Check for existing sessions only after authentication</title>
<updated>2026-11-09T03:09:41+00:00</updated>
<author>
<name>Praneeth Balasubramanian</name>
<email>praneeth@ucsb.edu</email>
</author>
<published>2026-10-29T20:54:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=48d3b732e5ad3fffe74e033d9a3cf47ebaa314b0'/>
<id>48d3b732e5ad3fffe74e033d9a3cf47ebaa314b0</id>
<content type='text'>
In the operational-negotiation path (CSG=1), iscsi_target_handle_csg_one()
calls iscsi_target_check_for_existing_instances() before
iscsi_conn_authenticated(). An initiator can therefore send a first Login
PDU with CSG=1, TSIH=0 and no CHAP exchange, carrying the InitiatorName and
ISID of an existing session. The target reinstates that session, which
tears down the legitimate initiator's connection. Only afterwards does it
reject the login with AUTH_FAILED.

iscsi_check_for_session_reinstatement() matches on ISID, InitiatorName and
SessionType only. The InitiatorName is not secret, and open-iscsi ISIDs are
a fixed OUI followed by a small session counter. A remote peer with no
credentials can thus repeatedly disconnect a CHAP-authenticated session and
keep its I/O failing.

The comment above iscsi_target_check_for_existing_instances() already
states the intended invariant:

  NOTE: We check for existing sessions or connections AFTER the initiator
  has been successfully authenticated in order to protect against faked
  ISID/TSIH combinations.

The security-negotiation path (CSG=0) honours this, calling the check only
once authentication completes. Move the CSG=1 call below the authentication
check so both paths behave the same. When authentication is not required,
iscsi_conn_authenticated() returns true and behaviour is unchanged.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Cc: stable@vger.kernel.org
Signed-off-by: Praneeth Balasubramanian &lt;praneeth@ucsb.edu&gt;
Link: https://patch.msgid.link/20261029205456.1211532-1-praneethb2002@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the operational-negotiation path (CSG=1), iscsi_target_handle_csg_one()
calls iscsi_target_check_for_existing_instances() before
iscsi_conn_authenticated(). An initiator can therefore send a first Login
PDU with CSG=1, TSIH=0 and no CHAP exchange, carrying the InitiatorName and
ISID of an existing session. The target reinstates that session, which
tears down the legitimate initiator's connection. Only afterwards does it
reject the login with AUTH_FAILED.

iscsi_check_for_session_reinstatement() matches on ISID, InitiatorName and
SessionType only. The InitiatorName is not secret, and open-iscsi ISIDs are
a fixed OUI followed by a small session counter. A remote peer with no
credentials can thus repeatedly disconnect a CHAP-authenticated session and
keep its I/O failing.

The comment above iscsi_target_check_for_existing_instances() already
states the intended invariant:

  NOTE: We check for existing sessions or connections AFTER the initiator
  has been successfully authenticated in order to protect against faked
  ISID/TSIH combinations.

The security-negotiation path (CSG=0) honours this, calling the check only
once authentication completes. Move the CSG=1 call below the authentication
check so both paths behave the same. When authentication is not required,
iscsi_conn_authenticated() returns true and behaviour is unchanged.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Cc: stable@vger.kernel.org
Signed-off-by: Praneeth Balasubramanian &lt;praneeth@ucsb.edu&gt;
Link: https://patch.msgid.link/20261029205456.1211532-1-praneethb2002@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: refresh kmalloc_obj() conversions</title>
<updated>2026-11-06T05:55:37+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees+treewide@kernel.org</email>
</author>
<published>2026-10-29T06:08:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0af298e62e5cff4ebf9bec47b8711177a7e2f115'/>
<id>0af298e62e5cff4ebf9bec47b8711177a7e2f115</id>
<content type='text'>
Refresh the tree with run of the existing Coccinelle rules in
scripts/coccinelle/api/kmalloc_objs.cocci, now that they also convert
arrays of multi-byte integers.

The conversions break down as:

	435	kzalloc_objs()
	169	kmalloc_objs()
	 52	kvzalloc_objs()
	 47	kzalloc_obj()
	 42	kvmalloc_objs()
	  8	kmalloc_obj()
	  2	kzalloc_flex()
	  2	kvmalloc_flex()

and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL.

Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, together
with the devm_kmalloc_obj() conversion that follows, on x86_64, arm64,
i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc,
xtensa, and openrisc with GCC 16.2.0 with no new warnings.

Signed-off-by: Kees Cook &lt;kees+treewide@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refresh the tree with run of the existing Coccinelle rules in
scripts/coccinelle/api/kmalloc_objs.cocci, now that they also convert
arrays of multi-byte integers.

The conversions break down as:

	435	kzalloc_objs()
	169	kmalloc_objs()
	 52	kvzalloc_objs()
	 47	kzalloc_obj()
	 42	kvmalloc_objs()
	  8	kmalloc_obj()
	  2	kzalloc_flex()
	  2	kvmalloc_flex()

and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL.

Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, together
with the devm_kmalloc_obj() conversion that follows, on x86_64, arm64,
i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc,
xtensa, and openrisc with GCC 16.2.0 with no new warnings.

Signed-off-by: Kees Cook &lt;kees+treewide@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: target: iscsi: Fix hanging WRITE_PENDING commands</title>
<updated>2026-11-05T03:16:27+00:00</updated>
<author>
<name>Dmitry Bogdanov</name>
<email>d.bogdanov@yadro.com</email>
</author>
<published>2026-10-27T18:01:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cae8db99f3956e6446827ae4a9605a1ed815772b'/>
<id>cae8db99f3956e6446827ae4a9605a1ed815772b</id>
<content type='text'>
When Data comes for an aborted WRITE command in WRITE_PENDING state it
is silently received and the command does not pass to the target. That
leads to hanging of other session with LUN_RESET aborting that command.

Pass the aborted WRITE commands when all Data has been gathered.

Signed-off-by: Dmitry Bogdanov &lt;d.bogdanov@yadro.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Tested-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Link: https://patch.msgid.link/20261027180123.13163-3-d.bogdanov@yadro.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When Data comes for an aborted WRITE command in WRITE_PENDING state it
is silently received and the command does not pass to the target. That
leads to hanging of other session with LUN_RESET aborting that command.

Pass the aborted WRITE commands when all Data has been gathered.

Signed-off-by: Dmitry Bogdanov &lt;d.bogdanov@yadro.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Tested-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Link: https://patch.msgid.link/20261027180123.13163-3-d.bogdanov@yadro.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: Revert "scsi: target: iscsi: Fix hang for aborted WRITE_PENDING commands"</title>
<updated>2026-11-05T03:16:27+00:00</updated>
<author>
<name>Dmitry Bogdanov</name>
<email>d.bogdanov@yadro.com</email>
</author>
<published>2026-10-27T18:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=94196cd3413fba6cf6d1f71d6de401e56caaf29b'/>
<id>94196cd3413fba6cf6d1f71d6de401e56caaf29b</id>
<content type='text'>
This reverts commit d5869dae5080e976d4b03cc33eb7ceb527f242bf as it
introduces double completion of the command and other issues.

Signed-off-by: Dmitry Bogdanov &lt;d.bogdanov@yadro.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Tested-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Link: https://patch.msgid.link/20261027180123.13163-2-d.bogdanov@yadro.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d5869dae5080e976d4b03cc33eb7ceb527f242bf as it
introduces double completion of the command and other issues.

Signed-off-by: Dmitry Bogdanov &lt;d.bogdanov@yadro.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Tested-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Link: https://patch.msgid.link/20261027180123.13163-2-d.bogdanov@yadro.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '7.3/scsi-fixes' into 7.4/scsi-staging</title>
<updated>2026-10-24T01:23:33+00:00</updated>
<author>
<name>Martin K. Petersen (Oracle)</name>
<email>mkp@kernel.org</email>
</author>
<published>2026-10-24T01:23:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=306158e878f49ecc7afd456065fc933689438346'/>
<id>306158e878f49ecc7afd456065fc933689438346</id>
<content type='text'>
Pull in scsi-fixes to resolve a merge conflict in libiscsi.c.

Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull in scsi-fixes to resolve a merge conflict in libiscsi.c.

Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: target: iscsi: Use crypto library API</title>
<updated>2026-10-15T02:03:45+00:00</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@kernel.org</email>
</author>
<published>2026-10-01T04:48:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b633249f58832e6aeefa606d6d5aec76abfe6d89'/>
<id>b633249f58832e6aeefa606d6d5aec76abfe6d89</id>
<content type='text'>
Make iscsi_target_auth.c call into the crypto library directly instead
of going through crypto_shash.  This is simpler and much more efficient,
as it avoids overhead of the crypto_shash layer.  The hash computation
itself also no longer has error codes that need to be checked.

For simplicity, still do a memory allocation per operation to buffer the
data (which is typically less than 50 bytes here) so that the one-shot
digest functions can be used.  It's still much more efficient than doing
the super slow crypto_alloc_shash().

Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@suse.de&gt;
Link: https://patch.msgid.link/20261001044857.169487-1-ebiggers@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make iscsi_target_auth.c call into the crypto library directly instead
of going through crypto_shash.  This is simpler and much more efficient,
as it avoids overhead of the crypto_shash layer.  The hash computation
itself also no longer has error codes that need to be checked.

For simplicity, still do a memory allocation per operation to buffer the
data (which is typically less than 50 bytes here) so that the one-shot
digest functions can be used.  It's still much more efficient than doing
the super slow crypto_alloc_shash().

Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@suse.de&gt;
Link: https://patch.msgid.link/20261001044857.169487-1-ebiggers@kernel.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: target: iscsi: Fix race in discovery auth updates</title>
<updated>2026-10-14T03:08:43+00:00</updated>
<author>
<name>Linfeng Sun</name>
<email>linfeng.sun.dev@gmail.com</email>
</author>
<published>2026-08-11T12:48:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e15b81f602edbdee39c335546f25486a1747f3f0'/>
<id>e15b81f602edbdee39c335546f25486a1747f3f0</id>
<content type='text'>
Separate configfs opens can concurrently update the discovery AuthMethod
parameter. Both callers may free the same value in
iscsi_update_param_value(), causing a double-free.

Protect the lookup and replacement with the discovery TPG access lock,
as used by the other TPG configfs parameter updates.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Signed-off-by: Linfeng Sun &lt;linfeng.sun.dev@gmail.com&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://patch.msgid.link/20260811124843.6817-1-linfeng.sun.dev@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Separate configfs opens can concurrently update the discovery AuthMethod
parameter. Both callers may free the same value in
iscsi_update_param_value(), causing a double-free.

Protect the lookup and replacement with the discovery TPG access lock,
as used by the other TPG configfs parameter updates.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Signed-off-by: Linfeng Sun &lt;linfeng.sun.dev@gmail.com&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Link: https://patch.msgid.link/20260811124843.6817-1-linfeng.sun.dev@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: target: iscsi: Reserve a terminator byte for the login payload</title>
<updated>2026-09-02T02:08:31+00:00</updated>
<author>
<name>Sujal Tuladhar</name>
<email>sujaltuladhar1231@gmail.com</email>
</author>
<published>2026-08-01T15:45:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f4825922d2fb371e2b969697d792077f1b62b62c'/>
<id>f4825922d2fb371e2b969697d792077f1b62b62c</id>
<content type='text'>
iscsi_target_check_login_request() rejects a login PDU whose
DataSegmentLength exceeds MAX_KEY_VALUE_PAIRS, but the test is '&gt;' and
login-&gt;req_buf is allocated with exactly MAX_KEY_VALUE_PAIRS
bytes. Since iscsit_get_login_rx() receives payload_length + padding
bytes, where

	padding = ((-payload_length) &amp; 3);

any payload_length from 8189 to 8192 fills the whole 8192 byte
buffer. The write stays in bounds, but no byte is left for a NUL
terminator.

The buffer is subsequently consumed as a C string. In the CHAP path
chap_check_algorithm() calls kstrdup(a_str), and extract_param() calls
strstr(in_buf, pattern) followed by strlen_semi(), none of which take a
length. convert_null_to_semi() additionally rewrites every embedded NUL
to ';', so even a payload made of well formed NUL separated key=value
records is left without a terminator. These walk past the end of the
object into adjacent slab memory. It is reachable by an unauthenticated
initiator against a portal configured for CHAP; when authentication is
not required iscsi_login_zero_tsih_s2() rewrites AuthMethod to None and
the CHAP path is never entered.

Allocate one extra byte. kzalloc() zeroes it and nothing ever writes to
it, as every writer copies to offset 0 for at most MAX_KEY_VALUE_PAIRS
bytes, so the buffer is always terminated.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Assisted-by: Claude Opus5 (custom harness)
Cc: stable@vger.kernel.org
Signed-off-by: Sujal Tuladhar &lt;sujaltuladhar1231@gmail.com&gt;
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
iscsi_target_check_login_request() rejects a login PDU whose
DataSegmentLength exceeds MAX_KEY_VALUE_PAIRS, but the test is '&gt;' and
login-&gt;req_buf is allocated with exactly MAX_KEY_VALUE_PAIRS
bytes. Since iscsit_get_login_rx() receives payload_length + padding
bytes, where

	padding = ((-payload_length) &amp; 3);

any payload_length from 8189 to 8192 fills the whole 8192 byte
buffer. The write stays in bounds, but no byte is left for a NUL
terminator.

The buffer is subsequently consumed as a C string. In the CHAP path
chap_check_algorithm() calls kstrdup(a_str), and extract_param() calls
strstr(in_buf, pattern) followed by strlen_semi(), none of which take a
length. convert_null_to_semi() additionally rewrites every embedded NUL
to ';', so even a payload made of well formed NUL separated key=value
records is left without a terminator. These walk past the end of the
object into adjacent slab memory. It is reachable by an unauthenticated
initiator against a portal configured for CHAP; when authentication is
not required iscsi_login_zero_tsih_s2() rewrites AuthMethod to None and
the CHAP path is never entered.

Allocate one extra byte. kzalloc() zeroes it and nothing ever writes to
it, as every writer copies to offset 0 for at most MAX_KEY_VALUE_PAIRS
bytes, so the buffer is always terminated.

Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
Assisted-by: Claude Opus5 (custom harness)
Cc: stable@vger.kernel.org
Signed-off-by: Sujal Tuladhar &lt;sujaltuladhar1231@gmail.com&gt;
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: target: iscsi: Fix hang for aborted WRITE_PENDING commands</title>
<updated>2026-08-29T02:18:58+00:00</updated>
<author>
<name>Maurizio Lombardi</name>
<email>mlombard@redhat.com</email>
</author>
<published>2026-07-17T14:38:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d5869dae5080e976d4b03cc33eb7ceb527f242bf'/>
<id>d5869dae5080e976d4b03cc33eb7ceb527f242bf</id>
<content type='text'>
When a LUN_RESET aborts a WRITE command that is in the
TRANSPORT_WRITE_PENDING state, the target core sets CMD_T_ABORTED and
waits for the frontend to finish processing.

If the initiator subsequently sends the remaining dataout PDUs,
__iscsit_check_dataout_hdr() catches the payload, stops the dataout
timer if the sequence is final and finally dumps the data.  However, the
iSCSI target doesn't trigger the completion process for these aborted
commands. Because of this, the abort path hangs indefinitely in
target_put_cmd_and_wait(), leading to a deadlocked target worker thread.

Fix this by explicitly calling target_complete_cmd() when the final
dataout PDU is received for an aborted WRITE command.
target_complete_cmd() detects the CMD_T_ABORTED flag and cleanly routes
the command into target_abort_work, allowing the abort completion to
successfully unblock.

Signed-off-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Link: https://patch.msgid.link/20260717143828.76291-2-mlombard@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a LUN_RESET aborts a WRITE command that is in the
TRANSPORT_WRITE_PENDING state, the target core sets CMD_T_ABORTED and
waits for the frontend to finish processing.

If the initiator subsequently sends the remaining dataout PDUs,
__iscsit_check_dataout_hdr() catches the payload, stops the dataout
timer if the sequence is final and finally dumps the data.  However, the
iSCSI target doesn't trigger the completion process for these aborted
commands. Because of this, the abort path hangs indefinitely in
target_put_cmd_and_wait(), leading to a deadlocked target worker thread.

Fix this by explicitly calling target_complete_cmd() when the final
dataout PDU is received for an aborted WRITE command.
target_complete_cmd() detects the CMD_T_ABORTED flag and cleanly routes
the command into target_abort_work, allowing the abort completion to
successfully unblock.

Signed-off-by: Maurizio Lombardi &lt;mlombard@redhat.com&gt;
Reviewed-by: Laurence Oberman &lt;loberman@redhat.com&gt;
Link: https://patch.msgid.link/20260717143828.76291-2-mlombard@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
