From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FFD4C64ED6 for ; Wed, 1 Mar 2023 09:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbjCAJrm (ORCPT ); Wed, 1 Mar 2023 04:47:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbjCAJrj (ORCPT ); Wed, 1 Mar 2023 04:47:39 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 568823B218; Wed, 1 Mar 2023 01:47:36 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 161071FE12; Wed, 1 Mar 2023 09:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1677664055; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FEKtKRNyGCTC82UqNy25qgA9yJtw4/FHNoYTpB8MPsE=; b=FWR/kfwDEEyMKMXV8Gye36g2Sj6laW5ZfRc975dH6P4XVUiDv/Fp0FHeRZPoXF9hWKGd9v pJWJL3iNNvoRbcGInAFRztMuJVhweZ3mJaMZsXvZaJyvx9SBSBuiqzT7toNdLlZxODUvGB ZymHyxMMA3fQPYQmsUavp4kNAYHw4u8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0748F13A63; Wed, 1 Mar 2023 09:47:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8wL4ADcf/2PhEwAAMHmgww (envelope-from ); Wed, 01 Mar 2023 09:47:35 +0000 Date: Wed, 1 Mar 2023 10:47:34 +0100 From: Michal Hocko To: Suren Baghdasaryan Cc: tj@kernel.org, hannes@cmpxchg.org, lizefan.x@bytedance.com, peterz@infradead.org, johunt@akamai.com, quic_sudaraja@quicinc.com, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] cgroup: limit cgroup psi file writes to processes with CAP_SYS_RESOURCE Message-ID: References: <20230301014651.1370939-1-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230301014651.1370939-1-surenb@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 28-02-23 17:46:51, Suren Baghdasaryan wrote: > Currently /proc/pressure/* files can be written only by processes with > CAP_SYS_RESOURCE capability to prevent any unauthorized user from > creating psi triggers. However no such limitation is required for > per-cgroup pressure files. Fix this inconsistency by requiring the same > capability for writing per-cgroup psi files. > > Fixes: 6db12ee0456d ("psi: allow unprivileged users with CAP_SYS_RESOURCE to write psi files") Is this really a regression from this commit? 6db12ee0456d is changing permissions of those files to be world writeable with the CAP_SYS_RESOURCE requirement. Permissions of cgroup files is not changed and the default mode is 644 (with root as an owner) so only privileged processes are allowed without any delegation. I think you should instead construct this slightly differently. The ultimate goal is to allow a reasonable delegation after all, no? So keep your current patch and extend it by removing the min timeout constrain and justify the change by the necessity of the granularity tuning as reported by Sudarshan Rajagopala. If this causes any regression then a revert would also return the min timeout constrain back and we will have to think about a different approach. The consistency with the global case is a valid point only partially because different cgroups might have different owners which is not usually the case for the global psi interface, right? Makes sense? -- Michal Hocko SUSE Labs