diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2020-09-03 13:24:11 +0200 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-09-07 13:14:30 +0200 |
commit | f44d04e696feaf13d192d942c4f14ad2e117065a (patch) | |
tree | ff70ce2d10b87bccdd6f7bad906d91beb262b2d5 /scripts | |
parent | f4d51dffc6c01a9e94650d95ce0104964f8ae822 (diff) | |
download | linux-f44d04e696feaf13d192d942c4f14ad2e117065a.tar.bz2 |
rbd: require global CAP_SYS_ADMIN for mapping and unmapping
It turns out that currently we rely only on sysfs attribute
permissions:
$ ll /sys/bus/rbd/{add*,remove*}
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/add_single_major
--w------- 1 root root 4096 Sep 3 20:37 /sys/bus/rbd/remove
--w------- 1 root root 4096 Sep 3 20:38 /sys/bus/rbd/remove_single_major
This means that images can be mapped and unmapped (i.e. block devices
can be created and deleted) by a UID 0 process even after it drops all
privileges or by any process with CAP_DAC_OVERRIDE in its user namespace
as long as UID 0 is mapped into that user namespace.
Be consistent with other virtual block devices (loop, nbd, dm, md, etc)
and require CAP_SYS_ADMIN in the initial user namespace for mapping and
unmapping, and also for dumping the configuration string and refreshing
the image header.
Cc: stable@vger.kernel.org
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions