Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3899682rwd; Mon, 22 May 2023 23:29:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6SePCuB2wbiML2cTGrfB2XLTnD1uKcwOW4GA+OGjxuLYuGdSgcOts2d7CQ98btZFt/VEUK X-Received: by 2002:a17:902:d48e:b0:1ac:8835:b881 with SMTP id c14-20020a170902d48e00b001ac8835b881mr13277005plg.17.1684823340697; Mon, 22 May 2023 23:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684823340; cv=none; d=google.com; s=arc-20160816; b=UjtJ5XfuejWSy1UoAc6/x1iSbkMc3NVDtotq13BG/hTHss+XEUOUna17hyADUx8fcb QCoKt6YcsUk0XLbDBBsD0nglaU6wH1AmywFgXGxWVp7TcGWJYNrq4eF0kG/vsEMHVsP6 eSrPvKUIgawYqZxKRIN8mOutPDerlwabaxvxvGE0yYHWffoz3JcSoqqnAqfPVfn+fuHN c4/yNdYVcqxJsq47lT2T9z8XvTlsRZNy4P8i/xsWu+1V0CJRXIOQhC8uzL2cIbnsy2Ub lU+2X/xfuOjVEjb05UxbUZvj+icedoSc0ZJ7v66+NYrHu2Qa4Nfh120YGrxPurooGV2/ YEhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=75jy5j4PBNe+Q/HP75wXCzh0bnY+IGGowgZslWgr9Uc=; b=KAldWhoNf+L6J9Zao0qau/0aTqj5Sn2OrE/XoevDpsEK2cwRfpnKwSbysxcOKfdbIe Z6RL0smpxzCHTcsOB991yW5e3B6crdLMZ5ekc69QvjtmTzxPF4gqSsAJVh8xB68kvAQe huE23UqV4+wgtPBIcOKaIHUb/3pmy8Mpaldc/xs0GQHIGs5AxH2tRewMhd0VYMkxeDYN I4ApCMaXeVNMSzYOEP46OZBh45WMag3aEuLZmkdMrDSntrZgKDiTmRsjZpdlgq6v8DF2 5gJ3hwPiQaQy/zEntFLwQiF4yImMeRwZj2LtIn+JKKH/MDPq6EtqC7UCtmFr/mPfWTT7 bQrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=2rh1jdRS; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jd21-20020a170903261500b001ab0a26d275si1691091plb.221.2023.05.22.23.28.48; Mon, 22 May 2023 23:29:00 -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; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=2rh1jdRS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235140AbjEWGTM (ORCPT + 99 others); Tue, 23 May 2023 02:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234680AbjEWGS4 (ORCPT ); Tue, 23 May 2023 02:18:56 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2119133; Mon, 22 May 2023 23:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=75jy5j4PBNe+Q/HP75wXCzh0bnY+IGGowgZslWgr9Uc=; b=2rh1jdRSlFVWBkmVPPU5nQ1iq3 xbzs1IfEBOlhOuBi9W8ZzInbFFOwg1/AtcevFI0qOTS8GVmykhhJrFIQ+SAo//dd5icd+IlZkPk9I /7jaVihTT8EAOamSlgsrnQ3aaQcM+l+j8Yl81taRluURoltYNPmgv/3FPlpONnXGJlHOFfVW4KXi3 TOI6G1VbDrXF8wod8vUz5zZ1CZgosjaMDQO/2793RP/H50AwwOHLqmEQZgbbKM9vNFukJNtENPWB2 lkXj5OnGM0FcFccweoZgI4SxFxKeas7ax7FNxWf2Du10ByKC7f7Xke6+4VoMDjFaG6gP/4vjfyVmw +Z1Ix6HA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q1LM6-0093sT-0c; Tue, 23 May 2023 06:18:46 +0000 Date: Mon, 22 May 2023 23:18:46 -0700 From: Christoph Hellwig To: Tianjia Zhang Cc: 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 Subject: Re: [PATCH 0/2] capability: Introduce CAP_BLOCK_ADMIN Message-ID: References: <20230511070520.72939-1-tianjia.zhang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230511070520.72939-1-tianjia.zhang@linux.alibaba.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Thu, May 11, 2023 at 03:05:18PM +0800, 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. Splitting out capabilities tends to massivel break userspace. Don't do it. > 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. I'm pretty sure the PR API can be keyed off just permissions on the block device node as nothing in it is fundamentally unsafe. Please work on relaxing the permissions checks there.