mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	linux-kernel@vger.kernel.org,
	kernel <kernel@savoirfairelinux.com>
Subject: Re: [PATCH 2/3] sysfs: Only accept read/write permissions for file attributes
Date: Wed, 21 Jan 2015 03:51:57 +0800	[thread overview]
Message-ID: <20150120195157.GA10864@kroah.com> (raw)
In-Reply-To: <20150120171312.GA24203@roeck-us.net>

On Tue, Jan 20, 2015 at 09:13:12AM -0800, Guenter Roeck wrote:
> 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 ?

I don't have the time to look at them this week, so feel free to fix up
what you know about and resend and I will get to them as soon as I can.

thanks,

greg k-h

  reply	other threads:[~2015-01-20 21:01 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
2015-01-20 19:51           ` Greg Kroah-Hartman [this message]
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=20150120195157.GA10864@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome