lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220829213215.lw233zzbvhevaqrm@builder.lan>
Date:   Mon, 29 Aug 2022 16:32:15 -0500
From:   Bjorn Andersson <andersson@...nel.org>
To:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Qiang Zhao <qiang.zhao@....com>, Li Yang <leoyang.li@....com>
Cc:     linux-kernel@...r.kernel.org, Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Konrad Dybcio <konrad.dybcio@...ainline.org>,
        linuxppc-dev@...ts.ozlabs.org,
        linux-arm-kernel@...ts.infradead.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH] soc: move from strlcpy with unused retval to strscpy

On Thu, Aug 18, 2022 at 11:01:06PM +0200, Wolfram Sang wrote:
> Follow the advice of the below link and prefer 'strscpy' in this
> subsystem. Conversion is 1:1 because the return value is not used.
> Generated by a coccinelle script.
> 
> Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
> ---
>  drivers/soc/fsl/qe/qe.c  | 4 ++--

Qiang, Li, would you like to merge this patch? Or could I perhaps get an
Acked-by from either of you so that I could take the patch through the
Qualcomm tree?

If you prefer:
Acked-by: Bjorn Andersson <bjorn.andersson@...aro.org>

Regards,
Bjorn

>  drivers/soc/qcom/smp2p.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c
> index b3c226eb5292..58746e570d14 100644
> --- a/drivers/soc/fsl/qe/qe.c
> +++ b/drivers/soc/fsl/qe/qe.c
> @@ -524,7 +524,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware)
>  	 * saved microcode information and put in the new.
>  	 */
>  	memset(&qe_firmware_info, 0, sizeof(qe_firmware_info));
> -	strlcpy(qe_firmware_info.id, firmware->id, sizeof(qe_firmware_info.id));
> +	strscpy(qe_firmware_info.id, firmware->id, sizeof(qe_firmware_info.id));
>  	qe_firmware_info.extended_modes = be64_to_cpu(firmware->extended_modes);
>  	memcpy(qe_firmware_info.vtraps, firmware->vtraps,
>  		sizeof(firmware->vtraps));
> @@ -599,7 +599,7 @@ struct qe_firmware_info *qe_get_firmware_info(void)
>  	/* Copy the data into qe_firmware_info*/
>  	sprop = of_get_property(fw, "id", NULL);
>  	if (sprop)
> -		strlcpy(qe_firmware_info.id, sprop,
> +		strscpy(qe_firmware_info.id, sprop,
>  			sizeof(qe_firmware_info.id));
>  
>  	of_property_read_u64(fw, "extended-modes",
> diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> index d9c28a8a7cbf..e9c8030d50ee 100644
> --- a/drivers/soc/qcom/smp2p.c
> +++ b/drivers/soc/qcom/smp2p.c
> @@ -422,7 +422,7 @@ static int qcom_smp2p_outbound_entry(struct qcom_smp2p *smp2p,
>  	char buf[SMP2P_MAX_ENTRY_NAME] = {};
>  
>  	/* Allocate an entry from the smem item */
> -	strlcpy(buf, entry->name, SMP2P_MAX_ENTRY_NAME);
> +	strscpy(buf, entry->name, SMP2P_MAX_ENTRY_NAME);
>  	memcpy(out->entries[out->valid_entries].name, buf, SMP2P_MAX_ENTRY_NAME);
>  
>  	/* Make the logical entry reference the physical value */
> -- 
> 2.35.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ