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]
Message-ID: <ZprhpkN0gBTrwyOt@google.com>
Date: Fri, 19 Jul 2024 14:59:02 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Charles Wang <charles.goodix@...il.com>
Cc: hadess@...ess.net, hdegoede@...hat.com, neil.armstrong@...aro.org,
	hughsient@...il.com, broonie@...nel.org, jeff@...undy.com,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] Input: goodix-berlin - Add sysfs interface for
 reading and writing touch IC registers

On Thu, May 30, 2024 at 04:53:11PM -0700, Dmitry Torokhov wrote:
> Hi Charles,
> 
> On Tue, May 14, 2024 at 07:44:43PM +0800, Charles Wang wrote:
> > +static ssize_t registers_read(struct file *filp, struct kobject *kobj,
> > +	struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count)
> > +{
> > +	struct regmap *regmap;
> > +	int error;
> > +
> > +	regmap = dev_get_regmap(kobj_to_dev(kobj), NULL);
> 
> We already have goodix_berlin_core->regmap, going through drvdata should
> be cheaper than scanning devres resources for the regmap data, so I'll
> change this.
> 
> > +	error = regmap_raw_read(regmap, (unsigned int)off,
> > +				buf, count);
> > +
> > +	return error ? error : count;
> > +}
> > +
> > +static ssize_t registers_write(struct file *filp, struct kobject *kobj,
> > +	struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count)
> > +{
> > +	struct regmap *regmap;
> > +	int error;
> > +
> > +	regmap = dev_get_regmap(kobj_to_dev(kobj), NULL);
> > +	error = regmap_raw_write(regmap, (unsigned int)off,
> > +				 buf, count);
> > +
> > +	return error ? error : count;
> > +}
> > +
> > +BIN_ATTR_RW(registers, 0);
> 
> I do not think it is a good idea to allow the world read all registers.
> Any objection to make it BIN_ATTR_ADMIN_RW()?

OK, since I have not heard anything I made the changes and applied the
patch.

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ