mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Yehyeong Lee <yhlee@isslab.korea.ac.kr>,
	lduncan@suse.com, cleech@redhat.com,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com
Cc: open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 1/3] scsi: libiscsi: reject a negative task index from parse_pdu_itt
Date: Tue, 6 Oct 2026 19:08:51 -0500	[thread overview]
Message-ID: <60f874ba-ab80-48c7-9c00-4ce8bf19e20f@oracle.com> (raw)
In-Reply-To: <20260804040546.2264137-2-yhlee@isslab.korea.ac.kr>

On 8/3/26 11:05 PM, Yehyeong Lee wrote:
> A transport that implements parse_pdu_itt hands libiscsi an index taken
> from the PDU, and both lookups bound it from above only:
> 
>       if (i >= session->cmds_max)
> 
> i and cmds_max are both int, so a negative index passes and
> session->cmds[i] is read from before the array.
> 
> be2iscsi produces one. beiscsi_parse_pdu() assigns the raw tag,
> 
>       *index = (int)itt;
> 
> and beiscsi_complete_pdu() forwards an unsolicited NOP-In from the
> hardware async ring without replacing its ITT, so the value is the
> target's. It also reports the session's own age rather than the one in
> the tag, which leaves the age comparison in iscsi_verify_itt() with
> nothing to reject.
> 
> Bound the index from below in both lookups.
> 
> Fixes: bfead3b2cb46 ("[SCSI] be2iscsi: Adding msix and mcc_rings V3")
> Cc: stable@vger.kernel.org
> Signed-off-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Reviewed-by: Mike Christie <michael.christie@oracle.com>

  reply	other threads:[~2026-10-07  0:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  4:05 [PATCH v2 0/3] scsi: libiscsi: validate task lookups driven by target-supplied ITTs Yehyeong Lee
2026-08-04  4:05 ` [PATCH v2 1/3] scsi: libiscsi: reject a negative task index from parse_pdu_itt Yehyeong Lee
2026-10-07  0:08   ` Mike Christie [this message]
2026-08-04  4:05 ` [PATCH v2 2/3] scsi: libiscsi: validate the ITT reflected in a Reject PDU Yehyeong Lee
2026-10-07  0:14   ` Mike Christie
2026-08-04  4:05 ` [PATCH v2 3/3] scsi: libiscsi: validate the task named by a management response Yehyeong Lee
2026-10-07  0:15   ` Mike Christie
2026-08-04  6:24 ` [PATCH v2 0/3] scsi: libiscsi: validate task lookups driven by target-supplied ITTs 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=60f874ba-ab80-48c7-9c00-4ce8bf19e20f@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=cleech@redhat.com \
    --cc=lduncan@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=open-iscsi@googlegroups.com \
    --cc=stable@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®