Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp504086rwj; Sat, 17 Dec 2022 11:40:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXuQXjHaRxz4KkzC5dkoD7NWXU9u9YZdHfe5Flr22+VMowrFlK+l0ZVE8EQTnjuB5ctKr4aD X-Received: by 2002:a17:902:b591:b0:18f:aa25:46d with SMTP id a17-20020a170902b59100b0018faa25046dmr3176724pls.38.1671306026015; Sat, 17 Dec 2022 11:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671306025; cv=none; d=google.com; s=arc-20160816; b=zHarbJV4ARm1Q5DWUdos4PT62TeufVEFR614ewQ78jRADO8CLddjwqZ1dAVOIoVyIN 1O1cvRbRw7UjNUUopZQlvXaxH5J7pPHVM5E3A0+nJr3yPNmzMxnqU11fweS+4dBlM4H1 4yjETqk/XhSWn95QrklpTyGF796fUlipvszIUS+OGXjFALLjb/2qdOJTWa4oUTAWmsmi HO+qmXdwrlhmZGIn2pgr8YFk2aVJFMvAbs+WDQXibIwH+O507/VtE9/c4q7zYf2rLliF 5aZj2H66Wciy8XgCpe9EYWps3jctrq+/davW+rP9djFu/zQ/GuXqLSdTYLBGG0vhXdkY gOfQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0u7CleR3qq8AvpdUYPg91vFZVCJ99OPUJfM/02vLNlw=; b=GrXLZBLO3nrNMPn7b+/arocwUkhZRQO6TTUZJ1NF+cxsZbP/HsgUQbKA9NOQzGrDUN qmgs9dNmQJmFfF2YTopLXYjRCWvXfQRghCojeiwDkir2qIrxOy0t5GVxPaGOqnD9ohmC 6SZNm7dN6ILYj/W9cw7SOW4PXs0KWS3ZfBPscOrzFdeqZF/WlIvg9+aTHe2jgdXbJcAb InwrPU44BhSOCb8IksqV4L+dgHKCCJ4BsC4syETWnVIRSr4QbsbPKgkf+kdEHnE1tLjk KoXT8xEYG7AuQ27wRRX8pB/GOJkCGcZ486EopT/ltHzOLWmcQ/t6rcbY8qSOyPxXHMLP zUcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@icloud.com header.s=1a1hai header.b=xQLX3ogl; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=icloud.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020a1709027e4300b00186a5b86ea3si5748868pln.50.2022.12.17.11.40.14; Sat, 17 Dec 2022 11:40:25 -0800 (PST) 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=@icloud.com header.s=1a1hai header.b=xQLX3ogl; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=icloud.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229475AbiLQTS7 (ORCPT + 70 others); Sat, 17 Dec 2022 14:18:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiLQTS5 (ORCPT ); Sat, 17 Dec 2022 14:18:57 -0500 Received: from ms11p00im-qufo17291601.me.com (ms11p00im-qufo17291601.me.com [17.58.38.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E79610053 for ; Sat, 17 Dec 2022 11:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1671303169; bh=0u7CleR3qq8AvpdUYPg91vFZVCJ99OPUJfM/02vLNlw=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=xQLX3oglvw9jj4LBkFQyp7PGYDCx++70+esWXDfKX5PabBmINnGfaKinPlLCrv6Hq 3CcJ1eLN0gosGZCjVD4HAEm5jMTYwgAn3sJHTZTH49UZL2efdlUZg+dLlhWBlxe56y YK29+4Sd1zKeHGsNz26deqg9r6rGyLFMI/dK6UgwnklS7dUkOnWZaTXcGr7DgN9nzv DVfuuteo4h2sD6UAABzqrZigg1MdkESwUUN7UZgjahDVVgMV3R1+fPEFMYGlwclQJt c1KiH37Yx55siuTi2UPpuVg0K4RgFYVLCG2raojGKeFU1X591qA75ON3grbfiU0eAN qLouyAi6EiBng== Received: from thundercleese.localdomain (ms11p00im-dlb-asmtpmailmevip.me.com [17.57.154.19]) by ms11p00im-qufo17291601.me.com (Postfix) with ESMTPSA id 18CCE3A04FF; Sat, 17 Dec 2022 18:52:48 +0000 (UTC) From: Eric Van Hensbergen To: v9fs-developer@lists.sourceforge.net, asmadeus@codewreck.org, rminnich@gmail.com, lucho@ionkov.net Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux_oss@crudebyte.com, Eric Van Hensbergen Subject: [PATCH 2/6] Don't assume UID 0 attach Date: Sat, 17 Dec 2022 18:52:06 +0000 Message-Id: <20221217185210.1431478-3-evanhensbergen@icloud.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221217185210.1431478-1-evanhensbergen@icloud.com> References: <20221217185210.1431478-1-evanhensbergen@icloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: J9qBR71ssgp32bkMQLDyUkQPVdEKomI3 X-Proofpoint-ORIG-GUID: J9qBR71ssgp32bkMQLDyUkQPVdEKomI3 X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.572,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-14=5F01:2022-01-14=5F01,2020-02-14=5F11,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 adultscore=0 mlxlogscore=377 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2212170174 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 The writeback_fid fallback code assumes a root uid fallback which breaks many server configurations (which don't run as root). This patch switches to generic lookup which will follow argument guidence on access modes and default ids to use on failure. There is a deeper underlying problem with writeback_fids in that this fallback is too standard and not an exception due to the way writeback mode works in the current implementation. Subsequent patches will try to associate writeback fids from the original user either by flushing on close or by holding onto fid until writeback completes. Signed-off-by: Eric Van Hensbergen --- fs/9p/fid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/9p/fid.c b/fs/9p/fid.c index 805151114e96..1fbd12d581bb 100644 --- a/fs/9p/fid.c +++ b/fs/9p/fid.c @@ -304,7 +304,9 @@ struct p9_fid *v9fs_writeback_fid(struct dentry *dentry) int err; struct p9_fid *fid, *ofid; - ofid = v9fs_fid_lookup_with_uid(dentry, GLOBAL_ROOT_UID, 0); + /* pull default uid from dfltuid */ + + ofid = v9fs_fid_lookup(dentry); fid = clone_fid(ofid); if (IS_ERR(fid)) goto error_out; -- 2.37.2