From nobody Mon Feb 9 08:36:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1625486219; cv=none; d=zohomail.com; s=zohoarc; b=Vc8HCS1XjwjUIMxzseifNUVJDqmJJM2yK6fh0HT8UK6WyAZnbWl5lEzlF+TNa3dOjOpurLF+kcLb/vWC8qV4ECZGUtZH8q6is9yGBf0lRLe+duTBMO51dxkf57lQHi4twZC4EmAE9RPSSkEBdXMPaewiJE1FzP8HaL26m3pSdXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625486219; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=M6cQKyyjVI2PrbetkpEHgX4Bmf/t2bSBB51HGXGJfH4=; b=MlJiE9LY8mv0mEAylOWP8xAD0jjvCOBfuY6ulddO6kePRBx01Fw2vnRlcNkkPUTYhimOLgNujsubyoj/z5nSIEK+3jVSHZRtJiBuhLfXXwFYt3dUVgRI6J0Kh5w6gDfRz/MCQZj+MBwTWyojYPO+r6W7CX+HGdhKVWNVu5sFb+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162548621919629.768275311268894; Mon, 5 Jul 2021 04:56:59 -0700 (PDT) Received: from localhost ([::1]:58722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0NDe-0007Wd-0N for importer@patchew.org; Mon, 05 Jul 2021 07:56:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <8bf27550effb124221100c3c6f5d513dd29ec37d@lizzy.crudebyte.com>) id 1m0NCN-0005m9-Tp for qemu-devel@nongnu.org; Mon, 05 Jul 2021 07:55:40 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:57493) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <8bf27550effb124221100c3c6f5d513dd29ec37d@lizzy.crudebyte.com>) id 1m0NCM-0006N0-3h for qemu-devel@nongnu.org; Mon, 05 Jul 2021 07:55:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=M6cQKyyjVI2PrbetkpEHgX4Bmf/t2bSBB51HGXGJfH4=; b=A+ImY EEsGUaLhL8bRRgOHSFog/ur2P+ocIB0Rod+31I0D1XN8p3pCaDnUJtr0SW/O/uE0TMKS/xxl/Oa30 LYQ9SWIkYOPm5CtAwiTsiPwCZZMxM56wsi0rF/i733jOQvpb0ncWWsq60myPdG9kG7RJjtW92TudT NSpNoiGTAJwDwI4ImbBY9wVu23GCC7IUsRTv+lkZKiAS/m9kymyxe6DN6LIJKkuxIQZJF6I04Yl/V 4ZDz/f5sqF3LprOmqzbFjurh7Tv4SC+ZVZCRbQS3L25i9KuVtmjdlUPlzHvQJ6v++X8/6kVY2VkqH x8wzc294hlCIXYnB3vb8r3Mvrr5dQ==; Message-Id: <8bf27550effb124221100c3c6f5d513dd29ec37d.1625483630.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Mon, 05 Jul 2021 13:13:51 +0200 Subject: [PULL 3/8] 9pfs: fix not_same_qid() To: qemu-devel@nongnu.org, Peter Maydell Cc: Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=91.194.90.13; envelope-from=8bf27550effb124221100c3c6f5d513dd29ec37d@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1625486221362100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There is only one user of not_same_qid() which is v9fs_walk() and the latter is using it for comparing a client supplied path with the 9p export root path, for the sole purpose to prevent a Twalk request from escaping from the exported 9p tree via "..". However for that specific purpose the implementation of not_same_qid() is wrong; if mtime of the 9p export root path changed between Tattach and Twalk then not_same_qid() returns true when actually comparing against the export root path. To fix for the actual semantic being used, only compare QID path members, but do not compare version or type members. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: --- hw/9pfs/9p.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 89aa07db78..e10a02f71d 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1707,10 +1707,7 @@ static bool name_is_illegal(const char *name) =20 static bool not_same_qid(const V9fsQID *qid1, const V9fsQID *qid2) { - return - qid1->type !=3D qid2->type || - qid1->version !=3D qid2->version || - qid1->path !=3D qid2->path; + return qid1->path !=3D qid2->path; } =20 static void coroutine_fn v9fs_walk(void *opaque) --=20 2.20.1