Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1181271rdb; Fri, 1 Dec 2023 09:00:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGdCDfggdJyOgmYDvh/c4EUG/8Wx8rA9EOSkk7SNfWeOexUqpVP29LuLOoL372BZc6lsdli X-Received: by 2002:a17:90b:38c5:b0:286:55d8:15ab with SMTP id nn5-20020a17090b38c500b0028655d815abmr3516889pjb.25.1701450000540; Fri, 01 Dec 2023 09:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701450000; cv=none; d=google.com; s=arc-20160816; b=qnDebjlLqf++M1bTJ/TO4hgvW2hMJKc7wCtuQR9T4x9Mfkxq3+M8ryyX+co9wc1AYv 3Rdmh28ZqPflyAAawnsPOh9Fma5s9sTtJx53x24hAQJTJSs+GC1HMAf7A4I4xz1C7xVJ u49ykA3T3n93TqvYdMUivJlLej51bm1RzqnDueyHL5lumg3K/+Ec8+4XIQxgUMaDy8UY tbSu6QtmQWzZLhRqYJ/lb6FCUqbTzY5Cg7SIQxx9AV76k78FEGOT3TCiFIR5Fbt1Gs1H scHqCmXppghv6k/5zHCQKgPr8RjkclGWVMtRd4TquGImxjjVZb0pItv8ayBsA+KOOya0 ry8Q== 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:sender:dkim-signature; bh=p+HE4G/M4xxYiKysGfcg2/z2HVdiLx1XnANJ5af98uk=; fh=msdwVyUEal6LktZucAHEZKdUHrJVQxH88ZwRN6nXh7M=; b=O8MP0S03Kww0QXW5iVUXNwWPyVAAzztWaymrbjRspTJ/HIiT83fZ/gBwRgdy6M9mAP ewEqKLxtWFgYbiUG6iOCmMmTaEKXZzsCIBpj+HQ40ol1fZjRu3pO/10emGcTVmwK+DZP 6tfzRWZipwegShwlRS9On/EbY3L7hyFZrZrwLQIC3gB/F6IRlMbBGhgtL8Pc324EHj1i L0x38KI8u7YmdmNKWSqwp8hOSpD3KZ+K7TCCIurkpjGn9hvm3mPAya8N3UUNr8oOv+5g WHHocSgwXrxVMd7PBcONqjsC6TS4lyZNiAW4VARicdWPNUuCgy4TGGnSkVuQR1ujOwfj OFTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L+yFf7Ho; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id v1-20020a17090a898100b00280c9b49738si3886893pjn.84.2023.12.01.09.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 09:00:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=L+yFf7Ho; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D03C9844AB87; Fri, 1 Dec 2023 08:59:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378583AbjLAQ7p (ORCPT + 99 others); Fri, 1 Dec 2023 11:59:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjLAQ7n (ORCPT ); Fri, 1 Dec 2023 11:59:43 -0500 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74F47106 for ; Fri, 1 Dec 2023 08:59:50 -0800 (PST) Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-285b3a14b12so2140579a91.1 for ; Fri, 01 Dec 2023 08:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701449990; x=1702054790; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=p+HE4G/M4xxYiKysGfcg2/z2HVdiLx1XnANJ5af98uk=; b=L+yFf7HogqXevwszuiyoVTWCYlxWR0q1k7si501hFalw74MVMCKgP+t5UBBoGSSxSG +oScu7wfrclreiF40j2MCaYgVvswWcLjUXoPuIbiENLEZGC+HvoMKKTCrG9nF43sV90z k5PhunBQgyU3B29Bl8VC0AmO8KtgfIHnoJ1+UhvaEJABDOC7jiZZRXUySDoq/WeJ8s5j PND71WX0YpQDX+cQcBX7ENvyZrOqNmUx2IWs3OnIXFRtXil8pjg5C7R94p80Ga8BN7qK REmOkcdi2sXjXMBq3kTEnWQlxqbQzix30c2VNQuPpnVpFkIe/HB2Rz3oDd7zJoadSMCT dx0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701449990; x=1702054790; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p+HE4G/M4xxYiKysGfcg2/z2HVdiLx1XnANJ5af98uk=; b=SZVf3J6OTKKdhH/1paE9MnAx2iWPLmpWqV/FPMLh6yd2TXTdWmNrIOVbZJI8MQPITX b2o2/jWJdmshS2VRdVw0kpiVRqIrK96Kk7RYbM5nznxIqyvlMu/n/X+jnBsmcK9XO6Uq PI+HjWjkgyfeEtPVZhIef7I5JN902vZF6xlktg4a1XVqLiJy8hMsrWHqatc9NRKf/91i IR47zwpDDhcSyiL4jr7xeX4dF33RLjHYQwEhJAOtGU/WZWZv4iAbDOY34Zg9QbymXS+t q1bA9m3WyS0k5wsYzV/DewY50pSj9N9ljVrxBYQlmoXic41AB3TII2ziTlwsUsBTVqu2 mnAg== X-Gm-Message-State: AOJu0YzCUBmdLbeZw2L7ds4I8iLQKzYIa3A2Imu/jWCeTnDLm99yLsWV f9TwUAtuUpX1FQJB5jc5OJA= X-Received: by 2002:a17:90b:3ec2:b0:285:9833:d18b with SMTP id rm2-20020a17090b3ec200b002859833d18bmr23383583pjb.3.1701449989808; Fri, 01 Dec 2023 08:59:49 -0800 (PST) Received: from localhost ([2620:10d:c090:400::4:27ef]) by smtp.gmail.com with ESMTPSA id j3-20020a17090276c300b001ce664c05b0sm3564829plt.33.2023.12.01.08.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 08:59:49 -0800 (PST) Sender: Tejun Heo Date: Fri, 1 Dec 2023 06:59:47 -1000 From: Tejun Heo To: Max Kellermann Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] fs/kernfs/dir: obey S_ISGID Message-ID: References: <20231201125638.1699026-1-max.kellermann@ionos.com> <20231201125638.1699026-2-max.kellermann@ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231201125638.1699026-2-max.kellermann@ionos.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 08:59:58 -0800 (PST) On Fri, Dec 01, 2023 at 01:56:38PM +0100, Max Kellermann wrote: > Handling of S_ISGID is usually done by inode_init_owner() in all other > filesystems, but kernfs doesn't use that function. In kernfs, struct > kernfs_node is the primary data structure, and struct inode is only > created from it on demand. Therefore, inode_init_owner() can't be > used and we need to imitate its behavior. > > S_ISGID support is useful for the cgroup filesystem; it allows > subtrees managed by an unprivileged process to retain a certain owner > gid, which then enables sharing access to the subtree with another > unprivileged process. > > Signed-off-by: Max Kellermann Acked-by: Tejun Heo Thanks. -- tejun