From: Mike Christie <michael.christie@oracle.com>
To: Yehyeong Lee <yhlee@isslab.korea.ac.kr>, martin.petersen@oracle.com
Cc: ddiss@suse.de, linux-scsi@vger.kernel.org,
target-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] scsi: target: Fix NULL se_tpg dereference in target_complete()
Date: Sat, 25 Jul 2026 15:44:25 -0500 [thread overview]
Message-ID: <79ceea04-7fe3-48b2-91bc-48b208f10229@oracle.com> (raw)
In-Reply-To: <20260725165818.769963-1-yhlee@isslab.korea.ac.kr>
On 7/25/26 11:58 AM, Yehyeong Lee wrote:
> The same statement can fault one level earlier: se_sess->se_tpg itself may
> be NULL. After a session is deregistered, transport_deregister_session()
> clears se_sess->se_tpg, yet the isert receive path can still submit and
> complete a command that references that session, so the backend completion
> runs target_complete() with se_tpg == NULL and dereferences it:
>
> Oops: general protection fault, probably for non-canonical address ...
> KASAN: null-ptr-deref in range [0x0000000000000080-0x0000000000000087]
> Workqueue: ib-comp-wq ib_cq_poll_work
> RIP: 0010:target_complete_cmd_with_sense.part.0+0x17d/0xc90
> Call Trace:
> fd_execute_rw
> __target_execute_cmd
> iscsit_execute_cmd
> iscsit_sequence_cmd
> isert_recv_done
> __ib_process_cq
> ib_cq_poll_work
>
> The exact window in which an isert completion outlives the session
> deregistration has not been pinned down; the guard defends the dereference
> regardless of how the command reaches this point.
>
I think we need to figure out how we got into this situation because we
can't free the session while it's still in use.
next prev parent reply other threads:[~2026-07-25 20:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 16:58 Yehyeong Lee
2026-07-25 20:44 ` Mike Christie [this message]
2026-07-26 14:59 ` Yehyeong Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79ceea04-7fe3-48b2-91bc-48b208f10229@oracle.com \
--to=michael.christie@oracle.com \
--cc=ddiss@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
--cc=yhlee@isslab.korea.ac.kr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®