lkml.org 
[lkml]   [2006]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Binary sysfs blobs
On Tue, Apr 11, 2006 at 11:08:41AM -0700, Pete Zaitcev wrote:
> Hi, Greg:
>
> I was reviewing some patches here and noticed (yes, only now noticed) that
> we have operations on binary blobs in fs/sysfs/bin.c. I thought it wasn't
> part of the deal for sysfs, with one value per file and so on. I suppose
> it's too late to debate now, but I have a couple of questions:
>
> - Do you know of any conventions which allow to determine which file
> is binary? Maybe the name starting with an underscore or something?

Hm, no, no convention right now, sorry.

> - Is there a standing policy that reading from a sysfs file is not
> altering a state of the corresponding hardware? This is not related
> to blobs directly, but with people passing structs now, it's tempting
> to implement some extended protocols. I am concerned of stealing
> network packets by accident or something.

No. Binary sysfs files are for "pass-through" mode only. You are ONLY
allowed to use them if you want to read from, or write to, some bit of
hardware and not manipulate the data at all. Examples of this is the
raw PCI config space, firmware binary blobs and BIOS upgrades.

You should NEVER pass a raw structure through sysfs by using a binary
file. If anyone sees anywhere in the current kernel that does this,
please let me know and I'll go hit them with a big stick...

And yes, I know the documentation on the conventions for this is
seriously lacking. Fixing that is slowly moving up my TODO list...

Hope this helps,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-12 07:49    [W:0.076 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site