From nobody Fri Dec 26 11:43:21 2025 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (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 3F3B418BC30 for ; Tue, 3 Sep 2024 15:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.125.188.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725376644; cv=none; b=RliGfm7xEVIQ74uIML0hjXGre3++/HAB5FpwpSQkMxow4UOB+NCZ8fbM05a4p9cGr0N2xfLtvrN8Os2zxhWlQPl3mSMwV7vUhfaHNJwguTo6eun9EBWMrGO78TR70Cfx9bn/0C4/dvalzMAQuRQj3mJm8xwspO7IYUtkAbnb0WE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725376644; c=relaxed/simple; bh=n1q/EIb8QE/gzlW7TGaoEUxhlzstWKJksL6EQ5xdUDQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GQrIRc5VvAWTX5CJc1vQjBTi+LGHyZ2vZI35aZvhxPsXt3Llym+5aCWIVCz4KHRE+lUVSb/pDnLkvy62fbJH8DQrO9tUc66Qx69vi6KflEtzgvTtNvyB5UzcuMkOiBA4OW+ceqprSfz713Hs6S4/JPX5ddSHIMd234+ur3Ffhzc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com; spf=pass smtp.mailfrom=canonical.com; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b=tANZBw5B; arc=none smtp.client-ip=185.125.188.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="tANZBw5B" Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 1BAB63F323 for ; Tue, 3 Sep 2024 15:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1725376641; bh=q/dJXF5eC+NKzBxw8fqNSmpQ4hPcGmLwxIIccnA2zek=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tANZBw5BR951V0tjNwoKsuCYGXFvAADclmIOKRfh4mAc9V6XqygI96+/3hwQFfqVZ iWK3AP1xGmUHwSi3ubmPRlMQM9OvTXCxoujZz+k3lQrZZyRjFZZSVVN4DFqchMYsYC RFifrzgq/cky5RMbsvQjz6Fd8FhGx6LHgz+BgjZ+PzEnkh3tLvi9gFi1y8EWxce/5/ MgKw9P30rpfXNhQkrUL/y6ZLwvhULr4q7jiWx+EsGCj6Iix1RGrVBpNOuDKQIZG6nD jk8Zie9OAU0KNPlBd/DvoFqEeF3i8FabPTGLlu70NvpIxaAmUtChH6JZy28RWzxcsM 2zB19K9FqQYGQ== Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-53351fe4bb8so5436199e87.3 for ; Tue, 03 Sep 2024 08:17:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725376638; x=1725981438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q/dJXF5eC+NKzBxw8fqNSmpQ4hPcGmLwxIIccnA2zek=; b=j/8/qLX2jzSOakBzxfKa2ykQFoOhdaTELpAk44WL4lAlCrimm5lYAbTZUnUL0yyPsP JKDmBT7YM68AcAx7A5Z/EPIyPR66tiLV4qyHmlr/g9nTboCyNyQ7H/33Nq1nxVkG11ob eMBSDRKSJaaA/w8DxmJSRAaAdplOrnAa10Z5U1QwglC9+MK+OKSC4addMMmbCc7Jp7ac Dal0jNVtHDQWsFM41DDAItKxIjpYE894KCdNPWohk2ceMsG6NcxiM5/e2uD34Fws/e8m Nb/jS8g1SBZxbxfdw73tXBoIWTF7qEIRaivZ4zBDuCn9szaGThdtsauFvOjNgwwYnLfZ RrHQ== X-Forwarded-Encrypted: i=1; AJvYcCX2v8TLc7R1HbB63bOwoWo0N9SPr+6BXrW1afXdRqwYymgD2EhT+0MvNFs3bvDug/yZmlrSw0/+kgFev5w=@vger.kernel.org X-Gm-Message-State: AOJu0YyuXv8CNGBxeGFXAZECq2z81SbhedzYprzqgZkxK1sSai2aiN2X VDOr/V1Cf6zonmdXKVEvx0bnYmufDoYFiDQfuUEdFcBqhaMj5ASaeZrBaRXYvvfZB9Ebxb7oDUB asr3CNK/zMyjbq88hhR32y4T2GauIC86KheATqZjgf/DWfBR0zG3ql3ae4EdGfVXvc0XkvXJKwG BDUQ== X-Received: by 2002:a05:6512:12cb:b0:52c:8979:9627 with SMTP id 2adb3069b0e04-53546afaadamr9026104e87.3.1725376638412; Tue, 03 Sep 2024 08:17:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGeAr4W1tnViv/aJ8AvVT1RQIyOxpEgki6TmTjrWHhDfkxMRoGBh6oqad2TrUHYX4xemgG9Q== X-Received: by 2002:a05:6512:12cb:b0:52c:8979:9627 with SMTP id 2adb3069b0e04-53546afaadamr9026067e87.3.1725376637915; Tue, 03 Sep 2024 08:17:17 -0700 (PDT) Received: from amikhalitsyn.. ([188.192.113.77]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a19afb108sm156377166b.223.2024.09.03.08.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:17:17 -0700 (PDT) From: Alexander Mikhalitsyn To: mszeredi@redhat.com Cc: brauner@kernel.org, stgraber@stgraber.org, linux-fsdevel@vger.kernel.org, Seth Forshee , Miklos Szeredi , Amir Goldstein , Bernd Schubert , Alexander Mikhalitsyn , linux-kernel@vger.kernel.org Subject: [PATCH v4 13/15] fs/fuse: warn if fuse_access is called when idmapped mounts are allowed Date: Tue, 3 Sep 2024 17:16:24 +0200 Message-Id: <20240903151626.264609-14-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240903151626.264609-1-aleksandr.mikhalitsyn@canonical.com> References: <20240903151626.264609-1-aleksandr.mikhalitsyn@canonical.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is not possible with the current fuse code, but let's protect ourselves from regressions in the future. Cc: Christian Brauner Cc: Seth Forshee Cc: Miklos Szeredi Cc: Amir Goldstein Cc: Bernd Schubert Cc: Signed-off-by: Alexander Mikhalitsyn --- v4: - this commit added --- fs/fuse/dir.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index d316223bd00b..dd967402bf12 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1473,6 +1473,14 @@ static int fuse_access(struct inode *inode, int mask) =20 BUG_ON(mask & MAY_NOT_BLOCK); =20 + /* + * We should not send FUSE_ACCESS to the userspace + * when idmapped mounts are enabled as for this case + * we have fc->default_permissions =3D 1 and access + * permission checks are done on the kernel side. + */ + WARN_ON_ONCE(!(fm->sb->s_iflags & SB_I_NOIDMAP)); + if (fm->fc->no_access) return 0; =20 --=20 2.34.1