[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b645e195-7875-9fc3-a8de-6676dfe800b8@schaufler-ca.com>
Date: Thu, 11 May 2023 09:17:19 -0700
From: Casey Schaufler <casey@...aufler-ca.com>
To: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>,
Serge Hallyn <serge@...lyn.com>,
Paul Moore <paul@...l-moore.com>,
Stephen Smalley <stephen.smalley.work@...il.com>,
Eric Paris <eparis@...isplace.org>,
Frederick Lawler <fred@...udflare.com>,
Jens Axboe <axboe@...nel.dk>,
Joseph Qi <joseph.qi@...ux.alibaba.com>,
linux-security-module@...r.kernel.org, selinux@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH 0/2] capability: Introduce CAP_BLOCK_ADMIN
On 5/11/2023 12:05 AM, Tianjia Zhang wrote:
> Separated fine-grained capability CAP_BLOCK_ADMIN from CAP_SYS_ADMIN.
> For backward compatibility, the CAP_BLOCK_ADMIN capability is included
> within CAP_SYS_ADMIN.
>
> Some database products rely on shared storage to complete the
> write-once-read-multiple and write-multiple-read-multiple functions.
> When HA occurs, they rely on the PR (Persistent Reservations) protocol
> provided by the storage layer to manage block device permissions to
> ensure data correctness.
>
> CAP_SYS_ADMIN is required in the PR protocol implementation of existing
> block devices in the Linux kernel, which has too many sensitive
> permissions, which may lead to risks such as container escape. The
> kernel needs to provide more fine-grained permission management like
> CAP_NET_ADMIN to avoid online products directly relying on root to run.
>
> CAP_BLOCK_ADMIN can also provide support for other block device
> operations that require CAP_SYS_ADMIN capabilities in the future,
> ensuring that applications run with least privilege.
Can you demonstrate that there are cases where a program that needs
CAP_BLOCK_ADMIN does not also require CAP_SYS_ADMIN for other operations?
How much of what's allowed by CAP_SYS_ADMIN would be allowed by
CAP_BLOCK_ADMIN? If use of a new capability is rare it's difficult to
justify.
>
> Tianjia Zhang (2):
> capability: Introduce CAP_BLOCK_ADMIN
> block: use block_admin_capable() for Persistent Reservations
>
> block/ioctl.c | 10 +++++-----
> include/linux/capability.h | 5 +++++
> include/uapi/linux/capability.h | 7 ++++++-
> security/selinux/include/classmap.h | 4 ++--
> 4 files changed, 18 insertions(+), 8 deletions(-)
>
Powered by blists - more mailing lists