Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8408395rwr; Thu, 11 May 2023 00:22:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CgP55Hcyp+YOZvB+/Xz6aEC5pSWAfpfe1j5hwkmPl5LfxrqTkc4zCw56dUF5X8RFQPMyh X-Received: by 2002:a17:902:c1cd:b0:1ab:18ea:f922 with SMTP id c13-20020a170902c1cd00b001ab18eaf922mr20718788plc.52.1683789749177; Thu, 11 May 2023 00:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683789749; cv=none; d=google.com; s=arc-20160816; b=FLmwbblR6V3VcVSEYoINBrzNh/F4u8gFwATP2B4WLj3/L9wFeFGEd00uHSgymanKFm plWGqEqxclHdzaI8Fgv+tXoedxwrAEDt3MO6TLAVWxOeGSonElNrkiWpJq+3SH+PgKeY RlhTFRUTEN1ifjMpvAx5J8P/EWQ00QSEJungUx9QTRlj7kaLE4T8zLBUYxhIAtZXdYAe H9xu8cgq8z9ppSM3b7OA8FAey+kOnb88nBelBWhZntkERnetxNWnKir7tptOxvbxvYcm EnAefQnn6nh9dthCnYeJUDZPJjHwZQ4cSdPPEhlMzPZyIVo0JVnCZkIMRm3WwqlZUp0q V2QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2bs1bY9f2Al+wY6lg6c08I+n1wGp7d2gxoE2U36gX/8=; b=SsjhmsnCb0XVmMD7p5VKeeEiVZhk2JY8dKVHU1tzbNdZHDOKrMN7N3Yuy/gwXZJetj 1oEVGA5C7ybgQJTlBmBDV4myWvWJFDH0nYankLwU2Bf/jlYRx1+Zh/pz2jOk/1jHRrjq wbJlKohauVfKpP+UVyuifgwueah8ePm5peXHd/2/GkeL0H8+b4FfLuLdhyuMZGU5NMqs eFcS8EjSxte7erCEnIddNG9w/hxGXo7H1ZViHLSUK65AK/EK1npk2nuNRz45aSBhGnUR xKOg/cRWL9S6ZaLjNikQ2R6Azmz0oEggwZeB0jbCudE35i9kvk+AyMsFzK2hm7B43vwp w1RQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jn22-20020a170903051600b001a970d40828si2001270plb.603.2023.05.11.00.22.14; Thu, 11 May 2023 00:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237384AbjEKHGO (ORCPT + 99 others); Thu, 11 May 2023 03:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237229AbjEKHF7 (ORCPT ); Thu, 11 May 2023 03:05:59 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 830DC5FF2; Thu, 11 May 2023 00:05:29 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R361e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0ViJZHzM_1683788724; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0ViJZHzM_1683788724) by smtp.aliyun-inc.com; Thu, 11 May 2023 15:05:25 +0800 From: Tianjia Zhang To: Serge Hallyn , Paul Moore , Stephen Smalley , Eric Paris , Frederick Lawler , Jens Axboe , Joseph Qi , linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tianjia Zhang Subject: [PATCH 0/2] capability: Introduce CAP_BLOCK_ADMIN Date: Thu, 11 May 2023 15:05:18 +0800 Message-Id: <20230511070520.72939-1-tianjia.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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(-) -- 2.24.3 (Apple Git-128)