From: John Garry <john.g.garry@oracle.com>
To: Vegard Nossum <vegard.nossum@oracle.com>,
Kees Cook <keescook@chromium.org>,
Bart Van Assche <bvanassche@acm.org>
Cc: Hannes Reinecke <hare@suse.de>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
Adaptec OEM Raid Solutions <aacraid@microsemi.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, stable@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] scsi: aacraid: Allocate cmd_priv with scsicmd
Date: Tue, 31 Jan 2023 09:02:07 +0000 [thread overview]
Message-ID: <e4b04313-20e9-0060-5e29-17fac62a8234@oracle.com> (raw)
In-Reply-To: <1bb8de35-16ba-6c7c-0ef6-67a7226a0a2d@oracle.com>
On 28/01/2023 18:40, Vegard Nossum wrote:
> aac_priv() uses scsi_cmd_priv() which has the comment:
>
> /*
> * Return the driver private allocation behind the command.
> * Only works if cmd_size is set in the host template.
> */
>
> This is set for this driver:
>
> static struct scsi_host_template aac_driver_template = {
> [...]
> .cmd_size = sizeof(struct aac_cmd_priv),
>
> I looked around to see if there was some kind of "allocate cmd" helper,
> but couldn't find it -- scsi_ioctl_reset() allocates one (together with
> struct request) and there are a few uses of ->cmd_size in
> drivers/scsi/scsi_lib.c but there doesn't seem to be a common code path
> for this.
>
> I guess you could use dev->host->hostt->cmd_size or something, but that
> doesn't seem worth it since this is driver specific and we already know
> what the correct value should be.
How this driver allocates a SCSI cmd in this fashion is not proper, and
hostt->cmd_size would only apply when the SCSI command is allocated in
the proper fashion, that being as a request - __scsi_execute() ->
scsi_alloc_request() being an example.
Hannes did have a conversion for this driver to allocate a request in
https://urldefense.com/v3/__https://lore.kernel.org/linux-scsi/8efc0e24-3000-39d9-7676-e0896145f247@suse.de/__;!!ACWV5N9M2RV99hQ!MealB8BN3q8cxYSaB7yKEbHyDmFTNl0YNVQXpVw8Zd0-iNqQ-k4IFxnqONpixfavb0DqGWnkbDVjBJCE22mYq5Ly8Xs$
- hopefully we can progress that work at some stage.
Thanks,
John
next prev parent reply other threads:[~2023-01-31 9:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-28 0:04 [PATCH] scsi: aacraid: Allocate cmd_priv with scsicmd Kees Cook
2023-01-28 18:40 ` Vegard Nossum
2023-01-31 9:02 ` John Garry [this message]
2023-01-30 18:14 ` Hannes Reinecke
2023-01-30 18:19 ` Bart Van Assche
2023-02-08 23:16 ` Martin K. Petersen
2023-02-14 16:57 ` 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=e4b04313-20e9-0060-5e29-17fac62a8234@oracle.com \
--to=john.g.garry@oracle.com \
--cc=aacraid@microsemi.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.de \
--cc=himanshu.madhani@oracle.com \
--cc=jejb@linux.ibm.com \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=stable@vger.kernel.org \
--cc=vegard.nossum@oracle.com \
/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