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: <2BCD0159-9633-48D3-95B4-ED9631F182B7@konsulko.com>
Date:	Wed, 30 Dec 2015 10:51:08 +0200
From:	Pantelis Antoniou <pantelis.antoniou@...sulko.com>
To:	Joel Becker <jlbec@...lplan.org>
Cc:	Christoph Hellwig <hch@....de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Nicholas Bellinger <nab@...ux-iscsi.org>,
	k.opasiak@...sung.com, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] configfs: implement binary attributes

Hi Joel,

> On Dec 30, 2015, at 01:00 , Joel Becker <jlbec@...lplan.org> wrote:
> 
> On Thu, Dec 24, 2015 at 03:51:10PM +0100, Christoph Hellwig wrote:
>> From: Pantelis Antoniou <pantelis.antoniou@...sulko.com>
>> 
>> ConfigFS lacked binary attributes up until now. This patch
>> introduces support for binary attributes in a somewhat similar
>> manner of sysfs binary attributes albeit with changes that
>> fit the configfs usage model.
>> 
>> Problems that configfs binary attributes fix are everything that
>> requires a binary blob as part of the configuration of a resource,
>> such as bitstream loading for FPGAs, DTBs for dynamically created
>> devices etc.
> 
> Overall, I really like this addition.
> 

That’s good :)

>> @@ -423,7 +429,9 @@ static int configfs_attach_attr(struct configfs_dirent * sd, struct dentry * den
>> 	spin_unlock(&configfs_dirent_lock);
>> 
>> 	error = configfs_create(dentry, (attr->ca_mode & S_IALLUGO) | S_IFREG,
>> -				configfs_init_file);
>> +				(sd->s_type & CONFIGFS_ITEM_ATTR) ?
>> +					configfs_init_file :
>> +					configfs_init_bin_file);
> 
> BIN_ATTRs are the more uncommon type, at least for now.  I would think
> this code should check for special cases and fall back to ITEM_ATTR.  So
> reverse it.
> 
> 	(sd->s_type & CONFIGFS_ITEM_BIN_ATTR) ?
>  		configfs_init_bin_file :
> 		configfs_init_file
> 

OK.

>> +static ssize_t
>> +configfs_read_bin_file(struct file *file, char __user *buf,
>> +		       size_t count, loff_t *ppos)
>> +{
>> +	struct configfs_buffer *buffer = file->private_data;
>> +	struct dentry *dentry = file->f_path.dentry;
>> +	struct config_item *item = to_item(dentry->d_parent);
>> +	struct configfs_bin_attribute *bin_attr = to_bin_attr(dentry);
>> +	ssize_t retval = 0;
>> +	ssize_t len = min_t(size_t, count, PAGE_SIZE);
>> +
>> +	mutex_lock(&buffer->mutex);
>> +
>> +	/* we don't support switching read/write modes */
>> +	if (buffer->write_in_progress) {
>> +		retval = -EINVAL;
>> +		goto out;
>> +	}
> 
> These are valid arguments, it's just competing with another operation.
> Wouldn't something like EINPROGRESS or ETXTBSY make more sense and be
> more informative?  The same for configfs_write_bin_file().
> 

Yep, will be done.

> Joel 
> 

Regards

— Pantelis

PS. A big thanks to Christoph for keeping this going. I will shortly post a new version with the
requested changes incorporated.


> -- 
> 
> "Soap and education are not as sudden as a massacre, but they are more
> deadly in the long run."
> 	- Mark Twain
> 
> 
> 			http://www.jlbec.org/
> 			jlbec@...lplan.org

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ