From: Colin Cross <ccross@android.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Richard Purdie <richard.purdie@linuxfoundation.org>,
lkml <linux-kernel@vger.kernel.org>,
Bryan Wu <bryan.wu@canonical.com>
Subject: Re: sysfs permissions on dynamic attributes (led delay_on and delay_off)
Date: Sat, 21 Jul 2012 09:23:58 -0700 [thread overview]
Message-ID: <CAMbhsRSAX3mt0nEnfOC3ydFG5WfMNihAGXDJuBWQyrS2DcKS=g@mail.gmail.com> (raw)
In-Reply-To: <20120721161523.GB22896@kroah.com>
On Sat, Jul 21, 2012 at 9:15 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Sat, Jul 21, 2012 at 01:08:55PM -0300, Henrique de Moraes Holschuh wrote:
>> On Sat, 21 Jul 2012, Colin Cross wrote:
>> > The delay_on and delay_off files could easily override the values from
>> > the trigger.
>> >
>> > Sending a KOBJ_CHANGE uevent is not a great solution, it's still
>> > horribly racy in userspace. This script would never work reliably:
>> > echo timer > trigger
>> > echo 1000 > delay_on
>> > echo 1000 > delay_off
>> > echo 255 > brightness
>>
>> Yes, and the proper fix is to instead use a fully async userspace based on
>> uevent callbacks. Nasty as all hell. Or the quick fix, which is to wait
>> for the system to settle after every sysfs operation that could create new
>> sysfs nodes.
>>
>> You could make sure that (1) no sysfs operation will return control to
>> userspace until it is complete, so you'd have all new sysfs nodes available
>> at the time the first echo returns [I believe it already works like that],
>
> Yes it does, what's the problem here?
>
>> and (2) either enhance sysfs to create nodes with the desired ownership and
>> permissions
>
> From the kernel, you can also do this today, if you know it's "safe" for
> users to read/write them.
You can set the permissions, but I don't know of any way to set the
owner. For my case, I need them to be writable by the "system" user
but not by all users.
next prev parent reply other threads:[~2012-07-21 16:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-21 0:46 sysfs permissions on dynamic attributes (led delay_on and delay_off) Colin Cross
2012-07-21 4:08 ` Greg KH
2012-07-21 5:14 ` Colin Cross
2012-07-21 15:07 ` Greg KH
2012-07-21 7:33 ` Richard Purdie
2012-07-21 8:26 ` Colin Cross
2012-07-21 11:21 ` Richard Purdie
2012-07-21 14:31 ` Henrique de Moraes Holschuh
2012-07-21 15:42 ` Colin Cross
2012-07-21 16:08 ` Henrique de Moraes Holschuh
2012-07-21 16:15 ` Greg KH
2012-07-21 16:23 ` Colin Cross [this message]
2012-07-21 16:13 ` Greg KH
2012-07-21 16:22 ` Colin Cross
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='CAMbhsRSAX3mt0nEnfOC3ydFG5WfMNihAGXDJuBWQyrS2DcKS=g@mail.gmail.com' \
--to=ccross@android.com \
--cc=bryan.wu@canonical.com \
--cc=gregkh@linuxfoundation.org \
--cc=hmh@hmh.eng.br \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.purdie@linuxfoundation.org \
/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;
as well as URLs for NNTP newsgroup(s).