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: <20080205231842.GB8740@suse.de>
Date:	Tue, 5 Feb 2008 15:18:42 -0800
From:	Greg KH <gregkh@...e.de>
To:	Len Brown <lenb@...nel.org>
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH for review] ACPI: Create /sys/firmware/acpi/interrupts/
	counters

On Tue, Feb 05, 2008 at 06:12:09PM -0500, Len Brown wrote:
> On Tuesday 05 February 2008 17:18, Greg KH wrote:
> > On Tue, Feb 05, 2008 at 02:30:10AM -0500, Len Brown wrote:
> > > # cat /sys/firmware/acpi/interrupts/summary
> > > pm_timer     0
> > > glbl_lock    0
> > > power_btn    0
> > > sleep_btn    0
> > > rtc          0
> > > gpe00    0
> ...
> > > gpe1F    0
> > > gpe_hi    0
> > > gpe_total   63
> > > acpi_irq    63
> > 
> > Eeek!  Why?  What's wrong with individual files here?
> 
> My expectation is that this is a shell interface for debugging,
> not an API for programs.  ala /proc/interrupts.

Great, then use debugfs for it.  Please, don't put debug stuff like this
in sysfs, that's not what it is there for.  You can do whatever you want
in debugfs :)

> if we have 40 individual files, each with a number in it,
> it is less convenient to cat the file and paste the results
> into an email or bug report and have the receiver easily
> see what what count goes with what file -- or is there
> a version of cat that prints the file name before
> the contents of each file?
> 
> I've seen 
> more * | cat
> but one has to wonder why an interface would be built
> to make something so simple not be simple.

Use debugfs please.

> > What's to ensure 
> > that you aren't going to overflow your buffer?
> 
> Good question.  What's to ensure we don't overflow it
> when I print any other random string?
> Who allocates it and how big is it?

The core does, and if you are putting something too big in it, you are
using the sysfs interface wrong :)

Simple, one value per file is what sysfs is for.  Use debugfs for
debugging stuff.

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