public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Binary sysfs blobs
Date: Tue, 11 Apr 2006 13:42:03 -0700	[thread overview]
Message-ID: <20060411204203.GA6177@kroah.com> (raw)
In-Reply-To: <20060411110841.71390306.zaitcev@redhat.com>

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

  parent reply	other threads:[~2006-04-12  5:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-11 18:08 Binary sysfs blobs Pete Zaitcev
2006-04-11 18:57 ` Jesse Barnes
2006-04-11 20:42 ` Greg KH [this message]
2006-04-12 10:34   ` Pete Zaitcev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060411204203.GA6177@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox