Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2880782lqt; Tue, 23 Apr 2024 04:46:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW98moysehUdMkzWBdcIsS+8I/emnG4McGIk43ZsoGPQsgS/FYnBbeBN2L1ARC77LAGz4cbthEWZrp01kK6q2kFizFCYeWhE4nokoxjeg== X-Google-Smtp-Source: AGHT+IGg9WaxVEaFdQEqSgNLo2lHd91SEcam4JYvQlQWWmgXrbMBoU+W/K7FeGHo9tv3ZQwEy8TG X-Received: by 2002:a17:902:6f16:b0:1e4:469c:8791 with SMTP id w22-20020a1709026f1600b001e4469c8791mr10130130plk.25.1713872759844; Tue, 23 Apr 2024 04:45:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713872759; cv=pass; d=google.com; s=arc-20160816; b=H8QoMj6FIfzesZKC92+25tiiNttG6MVPy/h/2jKixbPeLXMXxV33HZFW+P7WlknuFF yT04+jR/eFUt3Tieg2qWqATHdr1tll/16tRn4tYWO125EHoSRaqv7P+LK3HBLI5nc8vm BK4CSXAItuaerK1WPDeh1u7/LxdsTShSWj41TBNYligu/oycNXNTc3ziqAXDLdBxY/OW XczwRupw7L0D3rYpttRTbRa1YlB8s+ZWKV6jI2pG4B/63hhn9hp230OlwAauKyIvbv6F MKRnwdu2ogB5pMHyhqNLjCyWdIjMvImM0IPbvOqUJak260dnEffnHBkwLgIfOgotCrAr d75Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=KQ+j5rJzsQ7/bOD36YB7ywPsh/3Em5brrlp0hyMpLDk=; fh=icE9Qf1OcB07Alzveb1rYUOqZMab+fTP3TLYqPqm36A=; b=lpz6V2LfCcX3H9ce7gsDcfkM5MirEh1THhQH+giAhkwDBfOGern/AbfM4avc3fXHXB p1tGwMv6//1OGRnG6F5wMAc1M8BbrMGMyObQqxPE3odrWmDJj/1ETzAiYa0yHo8/j9rO /0y1AAWG48U+SX/9YJXkALR46hg8GhwhnxZze1SKsxiIthm7iYag766UOlIObsfmEbpd 5uNn5P/b3w8vBu4BJpyTbZdFGdB9rIKUoUy9pQ+pK9ABK+NzI79quMRu4uMyXmOSuBJ+ 4fwGx/aE1+hUS54VSjW4IaSPr5ICcRmbpSxy6NHfuv5M9iuRj26i5qZUBMpVLu8r2FRh 9PoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lLWFKZLV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-155009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155009-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e10-20020a170903240a00b001e49428f32fsi9799050plo.252.2024.04.23.04.45.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 04:45:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lLWFKZLV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-155009-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155009-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1614BB251CA for ; Tue, 23 Apr 2024 11:40:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E066C84DE8; Tue, 23 Apr 2024 11:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lLWFKZLV" 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 00A6E824B1; Tue, 23 Apr 2024 11:40:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713872402; cv=none; b=h+cXGDkJwgbhnDjti9hHfnsC09L1umIrctN0kq5F+ChwkLKz0v6Awcc8/y4NdopeKF9oM0PQ/LUmGPREwuxiDD5E0o/VRTiJLnjY+87nZp51UJq/HvR43TWrHl/pJT2+Bvk9Vcs0YUXVhbrbitCRf5MuRRZiGUftDWnTRVHdLYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713872402; c=relaxed/simple; bh=uxG/CkClSDymNnYyfIlf2Wp9gxXub3W6bIqP+YwWKvE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jY9bcRSBLnXeVt2kMocsgI8kiqNdUm8Sp8+ktgEUWwu+fUhXFvsQJmJ/FoWQP43DrSUuv8esBQIwAP83Ozct0zWjljciSG0YCK0BTvHFbfSuwYkSYoNHIlYC3Ve++3BaRqoFFBHpnMteJrk3gDpzVV1olDz/l0QcEBKYEBJ6sG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lLWFKZLV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8557AC116B1; Tue, 23 Apr 2024 11:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713872401; bh=uxG/CkClSDymNnYyfIlf2Wp9gxXub3W6bIqP+YwWKvE=; h=From:To:Cc:Subject:Date:From; b=lLWFKZLVRhTGthnayGFse3ryC6sBCPPRKAPeVAtE0J+LrWdhmSeSzj/Bj/aWn4271 e6rBSCP6iHgdx+C29TUh/OAgGP87pxNDXuyi2ao45Iv5qgYkkOghCsW8msIDGKDv0w j+c3Xe7puLGMn0lvY370CLlOeLknf8c50Ftnkd4r7RTQ+Zmb4NfziDi7enElSxPups gpHe6ybE74sw/d3dwcI5EpKlvqEV43JATLyH9Fm8yBdaz5UfL5j0uM8/xvUT9++koa GwZn1DHXIRR5vPsZ4wV/1FlVJRG4jxhiy8i3sY9SVbYyQT4bSZg/mypLZi4YuSHs+o IVb90y/x2HZqA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Joakim Sindholt , Eric Van Hensbergen , Sasha Levin , lucho@ionkov.net, asmadeus@codewreck.org, v9fs@lists.linux.dev Subject: [PATCH AUTOSEL 6.8 01/18] fs/9p: only translate RWX permissions for plain 9P2000 Date: Tue, 23 Apr 2024 07:00:57 -0400 Message-ID: <20240423110118.1652940-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.7 Content-Transfer-Encoding: 8bit From: Joakim Sindholt [ Upstream commit cd25e15e57e68a6b18dc9323047fe9c68b99290b ] Garbage in plain 9P2000's perm bits is allowed through, which causes it to be able to set (among others) the suid bit. This was presumably not the intent since the unix extended bits are handled explicitly and conditionally on .u. Signed-off-by: Joakim Sindholt Signed-off-by: Eric Van Hensbergen Signed-off-by: Sasha Levin --- fs/9p/vfs_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 32572982f72e6..e337fec9b18e1 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -83,7 +83,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses, int res; int mode = stat->mode; - res = mode & S_IALLUGO; + res = mode & 0777; /* S_IRWXUGO */ if (v9fs_proto_dotu(v9ses)) { if ((mode & P9_DMSETUID) == P9_DMSETUID) res |= S_ISUID; -- 2.43.0