From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71152606A31A for ; Tue, 1 Dec 2026 19:15:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=crudebyte.com header.i=@crudebyte.com header.a=rsa-sha256 header.s=kylie header.b=T6xFu49B Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYTJj-0001Uo-0w; Tue, 01 Dec 2026 14:15:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYTJL-0001RQ-Ei; Tue, 01 Dec 2026 14:14:46 -0500 Received: from kylie.crudebyte.com ([5.189.157.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYTJI-0000mc-AT; Tue, 01 Dec 2026 14:14:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Content-Type:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Content-ID:Content-Description; bh=K+JxJ0YX7VldNURWXzGoQSCnJ76P3AW9wCvzN1uxN/4=; b=T6xFu49BcKvbhzVBpCjAdj90fg vcT25VwBM8vVjaX1k1xxy4ZCKpc+PqnbrJy+ew4TfyUyLyl2MpUFgbEWyvLydEj98UBDI9aOGg/Nt wno73NtPSsh/OsbYnAkuuoWCttNTrIq50cCdZtFphM0uv6oCIg5GYOx7oG914GyUXiSy6DdyU8p8/ ZvaU85CGy2sY0l0Wihby/C/LDE8HjTiPm+G1jy+kY1BNOechIpR9p8r/KzBwZ7IYyf8bZyU1MPNfw +SlRq7cUcd7caIBWsRRnaT0GbdgezYxundsqbEOkff7W+YTr03BGUloB9V+1gNCSkmXxGJbslZa5P 90nx8MYwHohsw4CvXni0JohXd/wRYHK41FUnmnsEa7Cj0z5HKSH2Zf1laHsjC7aP0TLMEKELdLpin bQh0pY2D8WGr0qcgqxu8CUDi4voZtdgCWMdH8EdAsetV3hW2NkqKFvOMFS3KyehVWkkpGn+0JZmuU gOB8XXrH1rMOyiYaXMNxxUxgq4MzLr/602oX4rfYcCbHc43XarlUezV+IQGbsz1Lqr0K1GohHsqi6 T2SV+kXDYJfDW88HYtpNvgx/6mViNvhCEMEDu7aXfmCHDpGIB5VjZY3fl0hTeNhuf7XXzrejFExVU u2J+N5JER2vdIvmw2o4cukof63vaMBDbXUvF7usiM=; From: Christian Schoenebeck To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Greg Kurz , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: Re: [PATCH 0/7] 9pfs: fix TOCTUA on concurrent FID-type assignments Date: Tue, 01 Dec 2026 20:14:31 +0100 Message-ID: <13018757.O9o76ZdvQC@weasel> In-Reply-To: References: X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Received-SPF: pass client-ip=5.189.157.229; envelope-from=qemu_oss@crudebyte.com; helo=kylie.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_PASS=-0.001, SPF_PASS=-0.001 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: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tuesday, 1 December 2026 19:51:04 CET Christian Schoenebeck wrote: > This series fixes the following issue: > https://gitlab.com/qemu-project/qemu/-/issues/4664 > (see patch 1 for a more compact issue description) Oops, I accidentally sent this series without threading. Just ignore it. I'll resend with proper threading. Sorry! /Christian > The actual fix is only one patch: > > - Patch 1: fix TOCTUA issue by introducing an intermediate, early > P9_FID_PENDING state > > The rest of the patches are test case changes required for covering the > fixed issue: > > - Patch 2: splits the test virtio device's qvirtqueue_kick() into > two functions (qvirtqueue_enqueue() and qvirtqueue_notify()). > > - Patch 3: adds new test virtio device function > qvirtqueue_wait_next_used() which allows to wait for the next element made > available the device, independent of order of appearance. > > - Patch 4: allows 9p test client to schedule several 9p requests > simultaniously. > > - Patch 5: moves strct P9Hdr from .c to .h file. > > - Patch 6: allows 9p test client to retrieve the next 9p server response, > independent of order of arrival. > > - Patch 7: finally provides the 9p test case guarding the issue fixed by > patch 1. > > Note: originally I started implementing the test as (non-deterministic) > race-test, but then realized, due to the way the fix applies behaviour, the > test actually degrades to a perfect deterministic 9p protocol check. > > Christian Schoenebeck (7): > hw/9pfs: make FID type assignment atomic across yields > libqos/virtio: split qvirtqueue_kick into enqueue and notify > libqos/virtio: add qvirtqueue_wait_next_used() > tests/9p-client: add ability to schedule requests without notifying > tests/9p-client: move struct P9Hdr into the client header file > tests/9p-client: add v9fs_resp_pop_next_hdr() > tests/9p: add FID type atomicity test cases > > hw/9pfs/9p.c | 55 ++++++++++++++++- > hw/9pfs/9p.h | 21 +++++++ > tests/qtest/libqos/virtio-9p-client.c | 89 +++++++++++++++++++++++---- > tests/qtest/libqos/virtio-9p-client.h | 18 ++++++ > tests/qtest/libqos/virtio.c | 73 +++++++++++++++++++--- > tests/qtest/libqos/virtio.h | 6 ++ > tests/qtest/virtio-9p-test.c | 71 +++++++++++++++++++++ > 7 files changed, 311 insertions(+), 22 deletions(-)