From: Rusty Russell <rusty@rustcorp.com.au>
To: Joe Perches <joe@perches.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
Linux Kernel Developers List <linux-kernel@vger.kernel.org>,
fes@google.com, Bjorn Helgaas <bhelgaas@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Simon Wood <simon@mungewell.org>
Subject: Stricter module param and sysfs permission checks
Date: Thu, 20 Mar 2014 13:43:44 +1030 [thread overview]
Message-ID: <87k3bpr28n.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1395211832.8649.40.camel@joe-AO722>
CC's trimmed, this is not a virtio issue.
Joe Perches <joe@perches.com> writes:
> On Wed, 2014-03-19 at 17:07 +1030, Rusty Russell wrote:
>> Ted: module_param(queue_depth, int, 444)
>> Joe: 0444!
>> Rusty: User perms >= group perms >= other perms?
>> Joe: CLASS_ATTR, DEVICE_ATTR, SENSOR_ATTR and SENSOR_ATTR_2?
...
>> /* Default value instead of permissions? */ \
>> - static int __param_perm_check_##name __attribute__((unused)) = \
>> - BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \
>
> Now missing test for ((perm) & 2)
>
> Dunno if that was ever necessary.
Yeah, that was introduced by Alexey Dobriyan in 2006. It didn't go
through me, though :( New check is better.
allmodconfig says this breaks some things:
drivers/mtd/devices/docg3.c:
__ATTR(f##id##_dps0_protection_key, S_IWUGO, NULL, dps0_insert_key), \
__ATTR(f##id##_dps1_protection_key, S_IWUGO, NULL, dps1_insert_key), \
drivers/regulator/virtual.c:
static DEVICE_ATTR(min_microvolts, 0666, show_min_uV, set_min_uV);
static DEVICE_ATTR(max_microvolts, 0666, show_max_uV, set_max_uV);
static DEVICE_ATTR(min_microamps, 0666, show_min_uA, set_min_uA);
static DEVICE_ATTR(max_microamps, 0666, show_max_uA, set_max_uA);
static DEVICE_ATTR(mode, 0666, show_mode, set_mode);
drivers/hid/hid-lg4ff.c:
static DEVICE_ATTR(range, S_IRWXU | S_IRWXG | S_IRWXO, lg4ff_range_show, lg4ff_range_store);
drivers/scsi/pm8001/pm8001_ctl.c:
static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUGO,
pm8001_show_update_fw, pm8001_store_update_fw);
... plus some staging.
So I've left that for a future patch.
Thanks,
Rusty.
next prev parent reply other threads:[~2014-03-20 4:14 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 17:31 [PATCH] virtio-blk: make the queue depth configurable Theodore Ts'o
2014-03-14 17:38 ` Joe Perches
2014-03-14 17:38 ` Joe Perches
2014-03-14 18:02 ` Theodore Ts'o
2014-03-14 18:02 ` Theodore Ts'o
2014-03-17 3:55 ` Rusty Russell
2014-03-17 3:55 ` Rusty Russell
2014-03-17 5:00 ` Joe Perches
2014-03-17 5:00 ` Joe Perches
2014-03-17 7:26 ` Joe Perches
2014-03-19 6:37 ` Rusty Russell
2014-03-19 6:37 ` Rusty Russell
2014-03-19 6:50 ` Joe Perches
2014-03-19 6:50 ` Joe Perches
2014-03-20 3:13 ` Rusty Russell [this message]
2014-03-20 4:27 ` Stricter module param and sysfs permission checks Dave Jones
2014-03-20 9:15 ` Alexey Dobriyan
2014-03-20 16:28 ` Robert Jarzmik
2014-06-18 15:07 ` Gobinda Charan Maji
2014-06-26 2:54 ` Gobinda Charan Maji
2014-07-03 5:52 ` Gobinda Charan Maji
2015-04-28 14:02 ` Gobinda Charan Maji
2014-03-19 16:07 ` [PATCH] virtio-blk: make the queue depth configurable Greg Kroah-Hartman
2014-03-19 16:07 ` Greg Kroah-Hartman
2014-03-19 16:57 ` Bjorn Helgaas
2014-03-19 17:31 ` Joe Perches
2014-03-19 17:31 ` Joe Perches
2014-03-20 3:35 ` Rusty Russell
2014-03-20 3:35 ` Rusty Russell
2014-03-20 2:50 ` Rusty Russell
2014-03-20 2:50 ` Rusty Russell
2014-03-19 16:57 ` Bjorn Helgaas
2014-03-17 7:26 ` Joe Perches
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=87k3bpr28n.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=adobriyan@gmail.com \
--cc=bhelgaas@google.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=fes@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
--cc=simon@mungewell.org \
--cc=tytso@mit.edu \
/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.