From: Guenter Roeck <linux@roeck-us.net>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
kernel <kernel@savoirfairelinux.com>
Subject: Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes
Date: Tue, 20 Jan 2015 09:13:12 -0800 [thread overview]
Message-ID: <20150120171312.GA24203@roeck-us.net> (raw)
In-Reply-To: <1272429736.105015.1421768641283.JavaMail.root@mail>
On Tue, Jan 20, 2015 at 10:44:01AM -0500, Vivien Didelot wrote:
> Hi Guenter,
>
[ ... ]
>
> > Anyway, my goal was to keep things simple. Taking some bits from the default
> > and others from the return value of the is_visible function isn't simple,
> > even more so since your code would require the is_visible function to mask
> > out SYSFS_PREALLOC to avoid the warning.
>
> While I'm still not sure about the consequences of flipping this SYSFS_PREALLOC
> bit at runtime, I do agree with your goal.
>
> Then to keep it simple, the scope of is_visible could be limited to any bit
> allowed at attribute declaration (using *_ATTR* macros). The compile-time check
> macro VERIFY_OCTAL_PERMISSIONS() allows any bit but S_IWOTH. The scope can be
> SYSFS_PREALLOC | 0775. (or 0664 if we want to avoid executables as well.)
>
> [ This will prevent some follow-up patches "avoid world-writable sysfs files".
> In the future, we may want a runtime equivalent of VERIFY_OCTAL_PERMISSIONS. ]
>
0775 and 0664 are both fine with me, with a preference for 0664. Before I
resubmit - Greg, any preference from your side ?
Thanks,
Guenter
next prev parent reply other threads:[~2015-01-20 17:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 21:43 [PATCH 0/3] sysfs: Refine is_visible API Guenter Roeck
2015-01-19 21:43 ` [PATCH 1/3] sysfs: Use only return value from is_visible for the file mode Guenter Roeck
2015-01-19 21:43 ` [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes Guenter Roeck
2015-01-20 0:07 ` Vivien Didelot
2015-01-20 2:42 ` Guenter Roeck
2015-01-20 15:44 ` Vivien Didelot
2015-01-20 17:13 ` Guenter Roeck [this message]
2015-01-20 19:51 ` Greg Kroah-Hartman
2015-01-19 21:43 ` [PATCH 3/3] sysfs: Document struct attribute_group Guenter Roeck
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=20150120171312.GA24203@roeck-us.net \
--to=linux@roeck-us.net \
--cc=gregkh@linuxfoundation.org \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.