The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: Bart Van Assche <bvanassche@acm.org>,
	avri.altman@wdc.com,  alim.akhtar@samsung.com,
	jejb@linux.ibm.com, martin.petersen@oracle.com,
	 can.guo@oss.qualcomm.com, ulf.hansson@linaro.org,
	jens.wiklander@linaro.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	mikebi@micron.com,  lporzio@micron.com,
	Bean Huo <beanhuo@micron.com>
Subject: Re: [RFC PATCH v1 2/2] scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices
Date: Tue, 16 Sep 2025 15:27:34 +0200	[thread overview]
Message-ID: <d80650f1b6515c4d97c4f34754d0328d38fb8a0d.camel@iokpp.de> (raw)
In-Reply-To: <0f08376b-569a-48d6-a551-e10b72b32354@acm.org>


Bart, 

On Mon, 2025-09-15 at 15:06 -0700, Bart Van Assche wrote:
> > +       /*
> > +        * Use serial number as device ID. Copy ASCII serial number data.
> > +        * This provides a unique device identifier for RPMB operations.
> > +        */
> > +       strncpy((char *)cid, sn, sizeof(cid) - 1);
> 
> strncpy() into an u32 array? Really? There are multiple alternatives
> available in the kernel that are better than strncpy(). Are you sure
> that you want to use strncpy()? Additionally, does copying a string into
> a u32 array introduce any endianness issues?
> 

I will change to:

u8 cid[16] = { };

/* Copy ASCII serial number into device ID (max 15 chars + NUL). */
strscpy(cid, sn, sizeof(cid));


> > +MODULE_DESCRIPTION("UFS RPMB integration into the RPBM framework using SCSI Secure In/Out");
> 
> RPBM or RPMB?
> 
> >         } else {
> > -               str = kmemdup(uc_str, uc_str->len, GFP_KERNEL);
> > +               str = kmemdup(uc_str->uc, uc_str->len, GFP_KERNEL);
> 
> Is the above change perhaps a bug fix that is completely independent of
> the rest of this patch?

sure, will be added in next version. thanks for Reviewing!

Kind regards,
Bean


      reply	other threads:[~2025-09-16 13:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 21:46 [RFC PATCH v1 0/2] Add OP-TEE based RPMB driver for UFS devices Bean Huo
2025-09-15 21:46 ` [RFC PATCH v1 1/2] rpmb: move rpmb_frame struct and constants to common header Bean Huo
2025-09-15 21:54   ` Bart Van Assche
2025-09-15 21:46 ` [RFC PATCH v1 2/2] scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices Bean Huo
2025-09-15 22:06   ` Bart Van Assche
2025-09-16 13:27     ` Bean Huo [this message]

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=d80650f1b6515c4d97c4f34754d0328d38fb8a0d.camel@iokpp.de \
    --to=beanhuo@iokpp.de \
    --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=lporzio@micron.com \
    --cc=martin.petersen@oracle.com \
    --cc=mikebi@micron.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