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: <CZ6DFL6061FS.2WMDPMSSBXX8S@walle.cc>
Date: Fri, 16 Feb 2024 09:47:27 +0100
From: "Michael Walle" <michael@...le.cc>
To: "Marco Felsch" <m.felsch@...gutronix.de>,
 <srinivas.kandagatla@...aro.org>, <gregkh@...uxfoundation.org>,
 <miquel.raynal@...tlin.com>, <rafal@...ecki.pl>
Cc: <linux-kernel@...r.kernel.org>, <kernel@...gutronix.de>
Subject: Re: [RFC PATCH] nvmem: core: add sysfs cell write support

Hi,

On Thu Feb 15, 2024 at 10:14 PM CET, Marco Felsch wrote:
> @@ -432,6 +466,7 @@ static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)
>  	struct bin_attribute **cells_attrs, *attrs;
>  	struct nvmem_cell_entry *entry;
>  	unsigned int ncells = 0, i = 0;
> +	umode_t mode;
>  	int ret = 0;
>  
>  	mutex_lock(&nvmem_mutex);
> @@ -456,15 +491,18 @@ static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)
>  		goto unlock_mutex;
>  	}
>  
> +	mode = nvmem_bin_attr_get_umode(nvmem);
> +
>  	/* Initialize each attribute to take the name and size of the cell */
>  	list_for_each_entry(entry, &nvmem->cells, node) {
>  		sysfs_bin_attr_init(&attrs[i]);
>  		attrs[i].attr.name = devm_kasprintf(&nvmem->dev, GFP_KERNEL,
>  						    "%s@%x", entry->name,
>  						    entry->offset);
> -		attrs[i].attr.mode = 0444;

cells are not writable if there is a read post process hook, see
__nvmem_cell_entry_write().

if (entry->read_post_processing)
	mode &= ~0222;

-michael

Download attachment "signature.asc" of type "application/pgp-signature" (253 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ