mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: "Greg KH" <gregkh@suse.de>
Cc: "Robin Getz" <rgetz@blackfin.uclinux.org>,
	viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org
Subject: Re: debugfs & vfs file permission issue?
Date: Tue, 6 Jan 2009 01:32:30 -0500	[thread overview]
Message-ID: <8bd0f97a0901052232l22b60386pbcd9438cc752638f@mail.gmail.com> (raw)
In-Reply-To: <20090106061946.GA10026@suse.de>

On Tue, Jan 6, 2009 at 01:19, Greg KH wrote:
> On Tue, Jan 06, 2009 at 12:54:58AM -0500, Mike Frysinger wrote:
>> On Tue, Jan 6, 2009 at 00:48, Greg KH wrote:
>> > On Mon, Jan 05, 2009 at 09:57:07PM -0500, Robin Getz wrote:
>> >> On 2.6.28-rc2, If I create a debugfs file with
>> >>
>> >>     debugfs_create_x16("SPORT1_TX", 0200 , parent, 0xFFC00910);
>> >
>> > Um, are you are passing in a pointer to a known memory location
>> > properly?  Why would it be ok for the kernel to directly read that
>> > location?
>>
>> it's a nommu system and the 0xffc00000+ addresses are always available
>
> Writable but not readable?  Isn't hardware fun :)

yeah and we have some readable but not writable addresses too :/

>> >> Although the file shows up as write only (no read):
>> >>
>> >> root:/> ls -l /sys/kernel/debug/blackfin/SPORT/SPORT1_TX
>> >> --w-------    1 root     root            0 Jan  1
>> >> 2007 /sys/kernel/debug/blackfin/SPORT/SPORT1_TX
>> >>
>> >> root:/> cat /sys/kernel/debug/blackfin/SPORT/SPORT1_TX
>> >>
>> >> Still works - and causes the read to occur, which crashes :(
>> >
>> > You're root, you can do anything :)
>>
>> any thoughts on how to declare debugfs files that are read or write
>> only ?  we'll have to add new helper functions or have it be a
>> parameter or declare our own debugfs file ?
>
> Just use debugfs_create_file() and use your own read/write functions to
> prevent a read or write from happening no matter what.  No new debugfs
> infrastructure should be needed.

would it be useful for this to be a common function ?  probably not so
much considering (i'm assuming) no one else has asked so far for such
a beast ...
-mike

  reply	other threads:[~2009-01-06  6:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06  2:57 Robin Getz
2009-01-06  5:48 ` Greg KH
2009-01-06  5:54   ` Mike Frysinger
2009-01-06  6:19     ` Greg KH
2009-01-06  6:32       ` Mike Frysinger [this message]
2009-01-06 12:05         ` Robin Getz
2009-01-06 15:12           ` Robin Getz
2009-01-06 15:20             ` Mike Frysinger
2009-01-06 21:20               ` Robin Getz
2009-01-06 23:11             ` Greg KH
2009-01-07  3:30               ` Robin Getz
2009-01-25 21:34             ` Greg KH
2009-06-02  7:00               ` [PATCH] debugfs: use specified mode to possibly mark files read/write only Mike Frysinger
2009-06-02 23:23                 ` Greg KH

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=8bd0f97a0901052232l22b60386pbcd9438cc752638f@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgetz@blackfin.uclinux.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®