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: <20130219131500.GW23197@arwen.pp.htv.fi>
Date:	Tue, 19 Feb 2013 15:15:00 +0200
From:	Felipe Balbi <balbi@...com>
To:	Borislav Petkov <bp@...en8.de>,
	Mauro Carvalho Chehab <mchehab@...hat.com>, <balbi@...com>,
	Greg KH <gregkh@...uxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>, <JBottomley@...allels.com>,
	<linux-scsi@...r.kernel.org>, <davem@...emloft.net>,
	<netdev@...r.kernel.org>,
	Doug Thompson <dougthompson@...ssion.com>,
	<linux-edac@...r.kernel.org>, <rjw@...k.pl>,
	<linux-pm@...r.kernel.org>
Subject: Re: SYSFS "errors"

On Tue, Feb 19, 2013 at 02:06:26PM +0100, Borislav Petkov wrote:
> On Tue, Feb 19, 2013 at 09:46:40AM -0300, Mauro Carvalho Chehab wrote:
> > Ah, now I see what you're meaning. That would require to dynamically
> > create a per-mci DEVICE_ATTR().
> 
> Dude, look at the code, we do that already. And you're using it with
> dev_attr_sdram_scrub_rate.
> 
> Simply change the permissions of the attribute before calling
> device_create_file.
> 
> pseudo:
> 
> 	umode_t mode = 0;
> 
> 	if (mci->set...)
> 		mode |= S_IWUSR;
> 
> 	if (mci->get...)
> 		mode |= S_IRUGO;
> 
> 
> 	dev_attr_sdram_scrub_rate.attr.mode = mode;
> 
> 	device_create_file(&mci->dev, &dev_attr_sdram_scrub_rate);
> 
> > No, on both cases, open() will return an error (-ENOENT against -EPERM).
> 
> What if it is a shell script doing:
> 
> cat /sys/devices/system/edac/mc/mc0/sdram_scrub_rate

what's the problem with that ?

$ cat /path/to/file/that/doesnt/exist.txt
cat: /path/to/file/that/doesnt/exist.txt: No such file or directory

Didn't see any gates to hell opening here...

-- 
balbi

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ