From: NeilBrown The ioctl requires CAP_SYS_ADMIN, so sysfs should too. Note that we don't require CAP_SYS_ADMIN for reading attributes even though the ioctl does. There is no reason to limit the read access, and much of the information is already available via /proc/mdstat Cc: Chris Wright Signed-off-by: Neil Brown Signed-off-by: Andrew Morton --- drivers/md/md.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN drivers/md/md.c~md-require-cap_sys_admin-for-re-configuring-md-devices-via-sysfs drivers/md/md.c --- a/drivers/md/md.c~md-require-cap_sys_admin-for-re-configuring-md-devices-via-sysfs +++ a/drivers/md/md.c @@ -1928,6 +1928,8 @@ rdev_attr_store(struct kobject *kobj, st if (!entry->store) return -EIO; + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; return entry->store(rdev, page, length); } @@ -2861,6 +2863,8 @@ md_attr_store(struct kobject *kobj, stru if (!entry->store) return -EIO; + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; rv = mddev_lock(mddev); if (!rv) { rv = entry->store(mddev, page, length); _