Skip to content

Commit

Permalink
drivers/mtd/devices/docg3.c: avoid world-writable sysfs files.
Browse files Browse the repository at this point in the history
In line with practice for module parameters, we're adding a build-time
check that sysfs files aren't world-writable.

Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Rusty Russell committed May 14, 2014
1 parent 7a6fed1 commit 993bcc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/devices/docg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,8 +1608,8 @@ static ssize_t dps1_insert_key(struct device *dev,
#define FLOOR_SYSFS(id) { \
__ATTR(f##id##_dps0_is_keylocked, S_IRUGO, dps0_is_key_locked, NULL), \
__ATTR(f##id##_dps1_is_keylocked, S_IRUGO, dps1_is_key_locked, NULL), \
__ATTR(f##id##_dps0_protection_key, S_IWUGO, NULL, dps0_insert_key), \
__ATTR(f##id##_dps1_protection_key, S_IWUGO, NULL, dps1_insert_key), \
__ATTR(f##id##_dps0_protection_key, S_IWUSR|S_IWGRP, NULL, dps0_insert_key), \
__ATTR(f##id##_dps1_protection_key, S_IWUSR|S_IWGRP, NULL, dps1_insert_key), \
}

static struct device_attribute doc_sys_attrs[DOC_MAX_NBFLOORS][4] = {
Expand Down

0 comments on commit 993bcc6

Please sign in to comment.