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:	Mon, 18 Feb 2013 14:26:18 -0800
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Borislav Petkov <bp@...en8.de>,
	Mauro Carvalho Chehab <mchehab@...hat.com>, balbi@...com,
	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 Mon, Feb 18, 2013 at 11:13:06PM +0100, Borislav Petkov wrote:
> On Mon, Feb 18, 2013 at 01:54:34PM -0800, Greg KH wrote:
> > Because sysfs is "one value per file" the lack of a file showing up
> > shouldn't cause any userspace tools any problems, that is why we did
> > things this way.
> >
> > But, of course, userspace programmers do know how to mess things up...
> 
> How about what I proposed earlier to Felipe:
> 
> --
> diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
> index 0ca1ca71157f..d2eef76d1d46 100644
> --- a/drivers/edac/edac_mc_sysfs.c
> +++ b/drivers/edac/edac_mc_sysfs.c
> @@ -704,7 +704,7 @@ static ssize_t mci_sdram_scrub_rate_show(struct device *dev,
>  	int bandwidth = 0;
>  
>  	if (!mci->get_sdram_scrub_rate)
> -		return -ENODEV;
> +		return sprintf(data, "N/A");
>  
>  	bandwidth = mci->get_sdram_scrub_rate(mci);
>  	if (bandwidth < 0) {
> 
> --
> 
> Would that hurt the sysfs policy? In this case we *can* read the file
> and it correctly tells us that scrub rate reading is not supported
> instead of having a number there.
> 
> Hmm.

I don't know, it depends on if userspace can handle this properly or
not.  What tools rely on this sysfs file?  WHat happens when they get a
non-number in the file?

thanks,

greg k-h
--
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