From patchwork Tue Mar 15 10:10:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Schoenebeck X-Patchwork-Id: 12781264 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CEAFCC433F5 for ; Tue, 15 Mar 2022 10:24:43 +0000 (UTC) Received: from localhost ([::1]:46490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU4M6-0000gz-S4 for qemu-devel@archiver.kernel.org; Tue, 15 Mar 2022 06:24:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <6f0813cafdbf683cdac8b1492dd4ef8699c5b1d9@lizzy.crudebyte.com>) id 1nU4KC-0006Lp-Ta for qemu-devel@nongnu.org; Tue, 15 Mar 2022 06:22:44 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:39885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <6f0813cafdbf683cdac8b1492dd4ef8699c5b1d9@lizzy.crudebyte.com>) id 1nU4KA-0004EU-Uy for qemu-devel@nongnu.org; Tue, 15 Mar 2022 06:22:44 -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:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Content-ID: Content-Description; bh=r/JnAloPKQ8t7DABjgg/vFlAY39w6ZtzK/gPs3HG2ZA=; b=iLdRV VYbpbTSJUy2+FReCReUYRo7BEOsNQJjkoPZoF3QFg0aexmZLycwmWWdnyWRkRtfmpDpH6GYCF/F+f /ksehilbWhKMRwiEg7kgHRBcn7LLsLUXmPGeEdT4lPggFs54ZZeyMHgwsrLFZyrscZXaE39igsi2K UeG3IPxAt+3xapQS0BudMBekKiBPJHslZ4mf8B1gKPbZI2fcIr28fwJQQAcdv2oYrNO7CeXK13cQK ki91M310aDM3D9IhkeOHE5sOJXRCk9Bt8M0OhIC8r7XG9x3s5CgMAb5GyTGAJY48d7M0kg5puN7pE J2MSgHwkkIMIT5ppIfrJG0JmlPn3Q==; Message-Id: From: Christian Schoenebeck Date: Tue, 15 Mar 2022 11:10:25 +0100 Subject: [PATCH v4 0/7] 9pfs: fix 'Twalk' protocol violation To: qemu-devel@nongnu.org Cc: Greg Kurz Received-SPF: none client-ip=91.194.90.13; envelope-from=6f0813cafdbf683cdac8b1492dd4ef8699c5b1d9@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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Currently the implementation of 'Twalk' does not behave exactly as specified by the 9p2000 protocol specification. Actual fix is patch 5; see the description of that patch for details of what this overall fix and series is about. PREREQUISITES ============= This series requires the following additional patch to work correctly: https://lore.kernel.org/qemu-devel/E1nTpyU-0000yR-9o@lizzy.crudebyte.com/ OVERVIEW OF PATCHES =================== Patch 4 is a preparatory (pure) refactoring change to make actual 'Twalk' fix patch 5 better readable. All the other patches are just additional test cases for guarding 'Twalk' behaviour. v3 -> v4: * QID returned by Twalk request in fs_walk_2nd_nonexistent() test should NOT be identical to root node's QID. [patch 7] * Fix actual 'fid unaffected' check in fs_walk_2nd_nonexistent() test by sending a subsequent 'Tgetattr' request. [patch 7] Christian Schoenebeck (7): tests/9pfs: walk to non-existent dir tests/9pfs: Twalk with nwname=0 tests/9pfs: compare QIDs in fs_walk_none() test 9pfs: refactor 'name_idx' -> 'nwalked' in v9fs_walk() 9pfs: fix 'Twalk' to only send error if no component walked tests/9pfs: guard recent 'Twalk' behaviour fix tests/9pfs: check fid being unaffected in fs_walk_2nd_nonexistent hw/9pfs/9p.c | 57 ++++++---- tests/qtest/virtio-9p-test.c | 201 ++++++++++++++++++++++++++++++++++- 2 files changed, 231 insertions(+), 27 deletions(-)