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 68243606A686 for ; Tue, 1 Dec 2026 19:46:05 +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=mDkHDnL3 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYTmm-0004wA-NC; Tue, 01 Dec 2026 14:45:08 -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 <15a6f996f19ae031f7b05b997465411bf385771a@kylie.crudebyte.com>) id 1xYTml-0004vg-MC; Tue, 01 Dec 2026 14:45:07 -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 <15a6f996f19ae031f7b05b997465411bf385771a@kylie.crudebyte.com>) id 1xYTmj-0001Ap-VM; Tue, 01 Dec 2026 14:45:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Cc:To:Subject:Date:From:Message-ID:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Content-ID: Content-Description; bh=waY/CRL4017oLlWIgHVZ7zHOYE9KZIBN4kbRtyqSDmU=; b=mDkHD nL3Wp80OF5uehiIy0Ni5RA8tge9ggnudwOhYQK0bS9pH9dXRgn4JBMOU1T5dr1hxZWDXMqqnGxvHy 4WNFOmOIpGmfrj898mr1rQvJ2pZJ3e8/q26gxla9cdPvfP4DvzvpjSc4eFWbKjIvZyTZ2KeJzVgDI FKPF3JbTj7m8RqxRMGtLf8FcP3TSLhPtIkfdvHqB1DG8pZhyh8B04asrvt3A9p4j9wgHhBUsZQX0H RL+wpSsZWBsC0QaRvt9G9t6+fZsI9IXj1daxT2y4Mnymh3QpzRL0deOMdr6sNV26LlDf40pXBQEVP 9O4sfWBiBQytN2FPkLqeqhI4anti+R080E/sawfY462JqdTUSM+t6L1dtTR5c5QgUFgUtwsqdsBTg U/JQWJGohdYbJajBWZ1VeqWWzDpIi3zn7aZ5yR8CrZsONwQqRv4L1v3imdQiQTajiRoDKEPF6sO/Z 8e3O5Freqw9jIPc1LkA02R0n0FneyhXwO3ivqigfJXW6NY6jd/6Kjb7P7UBQb9d1UjckuLN7GMR1g 1cKsgQaCCHTJpeSnnha0uoZ76y0hkXGOgmXMclCLkX0+ztjkrNG5NCtPFiX5R3br2vrYoTtvg0Ozj kCC/xC1eVfy1YkEN3Y1mzuLJn/j8NDbtVo10yXA5GtqYdjk0mRHLX9teBi03HQ=; Message-ID: From: Christian Schoenebeck Date: Tue, 1 Dec 2026 20:38:18 +0100 Subject: [PATCH v2 0/7] 9pfs: fix TOCTUA on concurrent FID-type assignments To: qemu-devel@nongnu.org, qemu-stable@nongnu.org Cc: Greg Kurz , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Received-SPF: pass client-ip=5.189.157.229; envelope-from=15a6f996f19ae031f7b05b997465411bf385771a@kylie.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 X-Archived-By: This series fixes the following issue: https://gitlab.com/qemu-project/qemu/-/issues/4664 (see patch 1 for a more compact issue description) 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. v2: no changes; just resent this series with proper email threading. 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(-) -- 2.47.3