From: Bean Huo <beanhuo@iokpp.de>
To: Avri Altman <Avri.Altman@sandisk.com>,
"avri.altman@wdc.com" <avri.altman@wdc.com>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"can.guo@oss.qualcomm.com" <can.guo@oss.qualcomm.com>,
"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
"beanhuo@micron.com" <beanhuo@micron.com>,
"jens.wiklander@linaro.org" <jens.wiklander@linaro.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] scsi: ufs: core: fix incorrect buffer duplication in ufshcd_read_string_desc()
Date: Thu, 02 Oct 2025 06:31:39 +0200 [thread overview]
Message-ID: <bcd555740e1168fb9237683b136cdfdac9a6916a.camel@iokpp.de> (raw)
In-Reply-To: <PH7PR16MB6196EB54F847DD32DE097770E5E6A@PH7PR16MB6196.namprd16.prod.outlook.com>
On Wed, 2025-10-01 at 10:03 +0000, Avri Altman wrote:
> > From: Bean Huo <beanhuo@micron.com>
> >
> > The function ufshcd_read_string_desc() was duplicating memory starting from
> > the beginning of struct uc_string_id, which included the length and type
> > fields. As a result, the allocated buffer contained unwanted metadata in
> > addition to the string itself.
> >
> > The correct behavior is to duplicate only the Unicode character array in the
> > structure. Update the code so that only the actual string content is copied
> > into
> > the new buffer.
> 2 Nits - only If you'll have another spin:
> Nit 1: maybe add one more sentence: This does not imply any ABI change as
> there are no current callers with SD_RAW
> Nit 2: you might want to remove the duplicate definitions of SD_ASCII_STD &
> SD_RAW
yes, thanks Avri. I will address it in next version.
Kind regards,
Bean
>
> >
> > Fixes: 5f57704dbcfe ("scsi: ufs: Use kmemdup in ufshcd_read_string_desc()")
> > Signed-off-by: Bean Huo <beanhuo@micron.com>
> Reviewed-by: Avri Altman <avri.altman@sandisk.com>
next prev parent reply other threads:[~2025-10-02 4:49 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 6:08 [PATCH v2 0/3] Add OP-TEE based RPMB driver for UFS devices Bean Huo
2025-10-01 6:08 ` [PATCH v2 1/3] rpmb: move rpmb_frame struct and constants to common header Bean Huo
2025-10-01 9:48 ` Avri Altman
2025-10-01 19:43 ` Bart Van Assche
2025-10-06 10:07 ` Jens Wiklander
2025-10-06 10:21 ` Ulf Hansson
2025-10-06 10:54 ` Bean Huo
2025-10-01 6:08 ` [PATCH v2 2/3] scsi: ufs: core: fix incorrect buffer duplication in ufshcd_read_string_desc() Bean Huo
2025-10-01 10:03 ` Avri Altman
2025-10-02 4:31 ` Bean Huo [this message]
2025-10-01 19:43 ` Bart Van Assche
2025-10-01 6:08 ` [PATCH v2 3/3] scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices Bean Huo
2025-10-01 7:50 ` Jens Wiklander
2025-10-02 13:37 ` Bean Huo
2025-10-08 15:07 ` Bean Huo
2025-10-13 8:21 ` Jens Wiklander
2025-10-13 12:04 ` Bean Huo
2025-10-13 12:22 ` Jens Wiklander
2025-10-13 15:42 ` Bean Huo
2025-10-13 15:53 ` Jens Wiklander
2025-10-23 11:32 ` Bean Huo
2025-10-01 10:06 ` Avri Altman
2025-10-02 13:19 ` Bean Huo
2025-10-08 11:47 ` Bean Huo
2025-10-08 12:16 ` Avri Altman
2025-10-01 19:51 ` Bart Van Assche
2025-10-02 13:38 ` Bean Huo
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=bcd555740e1168fb9237683b136cdfdac9a6916a.camel@iokpp.de \
--to=beanhuo@iokpp.de \
--cc=Avri.Altman@sandisk.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=can.guo@oss.qualcomm.com \
--cc=jejb@linux.ibm.com \
--cc=jens.wiklander@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ulf.hansson@linaro.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
all inboxes | Powered by JetHome®