[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d80650f1b6515c4d97c4f34754d0328d38fb8a0d.camel@iokpp.de>
Date: Tue, 16 Sep 2025 15:27:34 +0200
From: Bean Huo <beanhuo@...pp.de>
To: Bart Van Assche <bvanassche@....org>, avri.altman@....com,
alim.akhtar@...sung.com, jejb@...ux.ibm.com, martin.petersen@...cle.com,
can.guo@....qualcomm.com, ulf.hansson@...aro.org, jens.wiklander@...aro.org
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
mikebi@...ron.com, lporzio@...ron.com, Bean Huo <beanhuo@...ron.com>
Subject: Re: [RFC PATCH v1 2/2] scsi: ufs: core: Add OP-TEE based RPMB
driver for UFS devices
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
Powered by blists - more mailing lists