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: <66f8a3a6-22d5-8a1b-e011-c50de8e19e6c@infradead.org>
Date:   Fri, 19 Aug 2022 08:21:56 -0700
From:   Geoff Levand <geoff@...radead.org>
To:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        linux-kernel@...r.kernel.org
Cc:     Jens Axboe <axboe@...nel.dk>,
        Philipp Reisner <philipp.reisner@...bit.com>,
        Lars Ellenberg <lars.ellenberg@...bit.com>,
        Christoph Böhmwalder 
        <christoph.boehmwalder@...bit.com>, Jim Paris <jim@...n.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Nicholas Piggin <npiggin@...il.com>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Minchan Kim <minchan@...nel.org>,
        Nitin Gupta <ngupta@...are.org>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        linux-block@...r.kernel.org, drbd-dev@...ts.linbit.com,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] block: move from strlcpy with unused retval to strscpy

On 8/18/22 13:59, 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>
> ---
...
> diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
> index e1d080f680ed..c76e0148eada 100644
> --- a/drivers/block/ps3vram.c
> +++ b/drivers/block/ps3vram.c
> @@ -745,7 +745,7 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)
>  	gendisk->flags |= GENHD_FL_NO_PART;
>  	gendisk->fops = &ps3vram_fops;
>  	gendisk->private_data = dev;
> -	strlcpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name));
> +	strscpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name));
>  	set_capacity(gendisk, priv->size >> 9);
>  	blk_queue_max_segments(gendisk->queue, BLK_MAX_SEGMENTS);
>  	blk_queue_max_segment_size(gendisk->queue, BLK_MAX_SEGMENT_SIZE);

Seems OK for ps3vram.

Acked-by: Geoff Levand <geoff@...radead.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ