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]
Date:	Thu, 2 Feb 2012 13:37:37 +1300
From:	Austin Boyle <Austin.Boyle@...atnet.com>
To:	Wolfram Sang <w.sang@...gutronix.de>
CC:	<rtc-linux@...glegroups.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] rtc: ds1307: generalise ram size and offset

Hi Wolfram,

I'm sorry about the slow response - I was away at linux.conf.au and then
haven't found enough time since I got back. 

On Thu, 2012-01-19 at 20:45 +0100, Wolfram Sang wrote:
> Sorry, found another thing.
> 
> > +	if (chip) {
> > +		if (chip->nvram_size)
> > +			ds1307->nvram_size = chip->nvram_size;
> > +		if (chip->nvram_offset)
> > +			ds1307->nvram_offset = chip->nvram_offset;
> > +	}
> 
> I moved only the assignments...
> 
> >  
> >  	buf = ds1307->regs;
> >  	if (i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
> > @@ -893,11 +907,12 @@ read_rtc:
> >  		dev_dbg(&client->dev, "got IRQ %d\n", client->irq);
> >  	}
> >  
> > -	if (chip && chip->nvram56) {
> > +	if (chip && chip->nvram_size) {
> 
> .. to here when I saw...
> 
> > +		nvram.size = ds1307->nvram_size;
> 
> ... that nvram is static and we are changing it. Yeah, it is very unlikely but
> if we have two RTC with different nvram sizes, one of them will not work correctly.
I see the issue. Am I right that it would only occur when you have two
I2C buses, each with one of the RTC chips supported by this driver?

The fix I thought of would be to add a 'struct bin_attribute' pointer to
'struct ds1307' and then in the probe function allocate the structure,
set the size & callbacks, and pass it as an argument to
sysfs_create_bin_file. Do you think this is viable? 

It looks like Andrew Morton has already added this patch to the -mm
tree. Has he also grabbed the patches that this depends on?

Thanks,
Austin.



--
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