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] [day] [month] [year] [list]
Date:   Tue, 07 Mar 2023 21:49:55 +0100
From:   Michael Walle <michael@...le.cc>
To:     Miquel Raynal <miquel.raynal@...tlin.com>,
        Richard Weinberger <richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>
Cc:     linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
        stable@...r.kernel.org
Subject: Re: [PATCH 1/4] mtd: core: provide unique name for nvmem device, take
 two

Hi Miquel,

Am 2023-03-06 13:58, schrieb Michael Walle:
> Commit c048b60d39e1 ("mtd: core: provide unique name for nvmem device")
> tries to give the nvmem device a unique name, but fails badly if the 
> mtd
> device doesn't have a "struct device" associated with it, i.e. if
> CONFIG_MTD_PARTITIONED_MASTER is not set. This will result in the name
> "(null)-user-otp", which is not unique. It seems the best we can do is
> to use the compatible name together with a unique identifier added by
> the nvmem subsystem by using NVMEM_DEVID_AUTO.
> 
> Fixes: c048b60d39e1 ("mtd: core: provide unique name for nvmem device")
> Cc: stable@...r.kernel.org
> Signed-off-by: Michael Walle <michael@...le.cc>
> ---
>  drivers/mtd/mtdcore.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 0feacb9fbdac..3fe2825a85a1 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -888,8 +888,7 @@ static struct nvmem_device
> *mtd_otp_nvmem_register(struct mtd_info *mtd,
> 
>  	/* OTP nvmem will be registered on the physical device */
>  	config.dev = mtd->dev.parent;
> -	config.name = kasprintf(GFP_KERNEL, "%s-%s", dev_name(&mtd->dev), 
> compatible);
> -	config.id = NVMEM_DEVID_NONE;
> +	config.name = compatible;

Damn.. although the commit message says it using NVMEM_DEVID_AUTO,
this is missing here. :/

Since you already picked it, should I send a follow up patch or can
you just drop this patch and I'll resend it?

-michael

>  	config.owner = THIS_MODULE;
>  	config.type = NVMEM_TYPE_OTP;
>  	config.root_only = true;
> @@ -905,7 +904,6 @@ static struct nvmem_device
> *mtd_otp_nvmem_register(struct mtd_info *mtd,
>  		nvmem = NULL;
> 
>  	of_node_put(np);
> -	kfree(config.name);
> 
>  	return nvmem;
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ