Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Mike Christie <mchristi@redhat.com>
To: Bodo Stroesser <bstroesser@ts.fujitsu.com>,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org
Subject: Re: [PATCH v2] scsi: target: tcmu: userspace must not complete queued commands
Date: Mon, 18 May 2020 14:39:38 -0500	[thread overview]
Message-ID: <cbc8d169-2bf0-34ed-ccd7-e4a6f74260e7@redhat.com> (raw)
In-Reply-To: <20200518164833.12775-1-bstroesser@ts.fujitsu.com>

On 5/18/20 11:48 AM, Bodo Stroesser wrote:
> When tcmu queues a new command - no matter whether in command
> ring or in qfull_queue - a cmd_id from IDR udev->commands is
> assigned to the command.
> 
> If userspaces sends a wrong command completion containing the
> cmd_id of a command on the qfull_queue, tcmu_handle_completions()
> finds the command in the IDR and calls tcmu_handle_completion()
> for it. This might do some nasty things, because commands in
> qfull_queue do not have a valid dbi list.
> 
> To fix this bug, we no longer add queued commands to the idr.
> Instead the cmd_id is assign when a command is written to
> the command ring.
> 
> Due to this change I had to adapt the source code at several
> places where up to now an idr_for_each had been done.
> 
> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>

Acked-by: Mike Christie <mchristi@redhat.com>


  reply	other threads:[~2020-05-18 19:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 16:48 [PATCH v2] scsi: target: tcmu: userspace must not complete queued commands Bodo Stroesser
2020-05-18 19:39 ` Mike Christie [this message]
2020-05-20  2:30 ` Martin K. Petersen

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=cbc8d169-2bf0-34ed-ccd7-e4a6f74260e7@redhat.com \
    --to=mchristi@redhat.com \
    --cc=bstroesser@ts.fujitsu.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=target-devel@vger.kernel.org \
    /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