Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6952485rdb; Tue, 2 Jan 2024 22:11:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIObSDrzRX5yCoDbxETUDkpZN8gWUqMy4BHkiSrxznet1wZDpBepeKq7q3cRo1OtKYdvUL X-Received: by 2002:a17:906:b846:b0:a27:773d:6faf with SMTP id ga6-20020a170906b84600b00a27773d6fafmr2071620ejb.186.1704262290813; Tue, 02 Jan 2024 22:11:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704262290; cv=none; d=google.com; s=arc-20160816; b=WO1SBmtkKYNo1AcamEMfehzWkc6nzd/R92FZb3s4qLYxRjK++jgmIEEroYuXsNOzdY T92hy78Z5XPW2/bzbYYlINaB5Vq8Yo0B/E5nt+U5+OFTN47zft8+/sWm+2VzwjTBzvxT eMNotSAMQwpJyKj9lz1VBIWymuB3bSkSQmWdJgIIYO5PntoRv/TQmkXny/HTnm+ZfvnK DxQD/I0er7Czo3qMksdk+dTfnHBhIyZ9Brr7rQ9UZhUNFKcdiCETQUQTekZrPqeIxJM0 nYSBBszAuYYcDGoZHs8mjhNASYBVgH65Z485VISWwKsSW64zjZm4F0k0lD6MM+5bSuuh QLKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+QZ3Xmzx9NO8GybAyZVWEcP0nqnjfmF0eB8DFPqea0c=; fh=2NtHjZnOYgzh1C9f8aK2vDEJWCIuY4FW6TA8G/wPg/o=; b=cR3v6C0VbvGTSiyFXYtO0wF2wWMW4DvryYCUSrtkgJzf+0EcV2Frwh/nJdNUce+BiV lP+0oNvBeXv+9bUYLg4gCXwto752kNvuIpmaZq5+WUfoNjPWjCM5DzrwidehLbtwEn+j 5gyMgXrMJQHct1SsMzW+//j6X4fr15fEdOYIQ8hGEiqLp9mFMyTu0FOZTxrqw+MHP0l+ TaolKm5EsVCCUe/pqjh33jLtG6cyb5qL8t945q7yiJ+28bWPJ3TpmIb+n2e5RJmCDgNq EMaqj9c3ArTk7KsqT2/4mX40NG08gxXaCu6aTxmCOHlrA7QaLjIrVCmYNq5Yt4et8Lpk o5Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lUOhxGPX; spf=pass (google.com: domain of linux-kernel+bounces-15198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15198-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a21-20020a17090640d500b00a1d81bd5db5si10764564ejk.816.2024.01.02.22.11.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 22:11:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lUOhxGPX; spf=pass (google.com: domain of linux-kernel+bounces-15198-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15198-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 76AC01F23AFB for ; Wed, 3 Jan 2024 06:11:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33F7C179AB; Wed, 3 Jan 2024 06:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lUOhxGPX" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BAAB18021; Wed, 3 Jan 2024 06:11:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A6E3C433C7; Wed, 3 Jan 2024 06:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704262281; bh=mXoFmy8Y3AJ12pj/BfIyrgsROCK4abHRBJp59HxUUFk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lUOhxGPXiOv9qvzIoMUWK00D4AYNMMYZDBoMM+Zm9gCNZJrogT77GIGV1lIqdhMhD 4WwIBnmbsu6baNu+iBlY3zd9PYZ238EfbwF0oWjUiZradz5sAWmDhBivgSg6PlR2t4 qorkqxEq0FjXsSLM18dcdyUq4rdTkXWl1/JXrGr4= Date: Wed, 3 Jan 2024 07:11:18 +0100 From: Greg KH To: =?utf-8?B?5a2f5pWs5ae/?= Cc: brauner@kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: proposal to refine capability checks when _rlimit_overlimit() is true Message-ID: <2024010353-legwarmer-flap-869d@gregkh> References: <1a8ed7bd.c96e.18ccd4ee4d1.Coremail.mengjingzi@iie.ac.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1a8ed7bd.c96e.18ccd4ee4d1.Coremail.mengjingzi@iie.ac.cn> On Wed, Jan 03, 2024 at 11:12:28AM +0800, 孟敬姿 wrote: > Hi! > > We observed a potential refinement in the kernel/fork.c line 2368. > Currently, both CAP_SYS_ADMIN and CAP_SYS_RESOURCE are checked when > the limit is over system limit. We suggest considering an adjustment > to utilize CAP_SYS_RESOURCE exclusively. Here's our rationale for this > suggestion: As I said when you proposed changing CAP permissions on the tty ioctls, have you tried this and seen what actually breaks by doing so? Please audit the userspace code out there to ensure that what you are attempting to propose actually would work, and then, if so, submit a patch to do so. Attempts of "wouldn't it be nice", don't go very far as it shows that the work to do so hasn't actually been done. thanks, greg k-h