From nobody Sat May 30 17:44:06 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=1779300162; cv=none; d=zohomail.com; s=zohoarc; b=e3MF+Qsm/Vm2ahw1xRFyVZGHOfVCbpdfZpT4BCcOAaZkuhu2ogt4PDT+bk/sUqV0fCxnvByYqkbS6dT2AD7seteHiHDEMhJQVQNx/6tBzc4tObxbqiK59T31+Y7bxnu2TETlcfOSGr1R32WczIDTVIEAKEnwLqbT/nQ6ibel2pI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779300162; h=Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YrViNUl0kk5pNxyczeZpVNv9oMtV/Lu1Mt4drGo5OM0=; b=e1/v6t2HygFlaEuehwUCoAq3EKSqT0JAJTFj4X2y36DbNSHbhQu3KvNwdXvMeYwqpw1N4fhNNNGom1lWJuTWZztGClNTsrI3Ae69T7kc3+XykgK+cfCDs9iwvKAaMRlY5578LR6dpXmFw6VLOXyTKeM0wTnhIDOyVv+uTQ3nyrQ= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17793001625329.491904636930599; Wed, 20 May 2026 11:02:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wPlFR-0002hL-A9; Wed, 20 May 2026 14:02:29 -0400 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 1wPlF6-0002g4-K0 for qemu-devel@nongnu.org; Wed, 20 May 2026 14:02:07 -0400 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 1wPlF4-00041y-OU for qemu-devel@nongnu.org; Wed, 20 May 2026 14:02:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=kylie; h=Message-Id:Cc:To:Subject:Date:From:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Content-ID: Content-Description; bh=YrViNUl0kk5pNxyczeZpVNv9oMtV/Lu1Mt4drGo5OM0=; b=U0Rea PBojKu67acvoJC8HX+vfac+w89K+q2jjgOOrREJ5aNqnS7hi4a+2mTQesrlYJNEU1YfUIrtznyQAR DfJjbYpeZXrEXBRR/n98XFqI9tfT0e7hu1tetGdY+yfoBg5oO2Mn5ppEKgdVR4BIaUvjyKghXmYrm CMu7sm3PzMy32mPYPKYggqUGbBGuXjuPw7YPDzadS4vaIPQXa+Eztd21OPogrMbRFnoopu6l3O5aw A9LqfnS4MmgujmxbN+Duun7gtM2UbzjfLWwlQQ1X1LlB1Ue1o5Z23NA1jeK457kutaKO4OCEZuRpL Xqtw+NcIxMwfX+QGdmqnuYS4+oOhZzhAwIcW6z0UlqUOv7T66eIo1++iYtmiihaVQCONhb4Wjk2NM lqMRAAQKdv+1ocWqflmVhEnpLC3DhSrUgIqrXbIBgp9B51bqq55MDcn7IiSfGt/Aqwn84ofag+FCB zxQVNujwMFg8enyCZEj/QLOHnKlwF55PAgY+SAmcZJ89QFLieO1dQj9jnEL/4qzJyLUvuCKgeMQo7 TIQFCTXIv6b/2dYf5Rzhh7uk3wjVqQ+nRxglWjq5hFYYfVJ9hovTinc2ddSCIFac4jDU4Vpz3pM+9 urzGraithC3zj+7WInUW9AuefJO5lkQWqR1oeLYK0mPCy8FhAdgoUNV5WUEBF4=; From: Christian Schoenebeck Date: Wed, 20 May 2026 19:11:25 +0200 Subject: [PATCH] 9pfs: fix missing rename lock in v9fs_co_readdir_many (CVE-2026-48004) To: qemu-devel@nongnu.org Cc: Greg Kurz , sin99xx Message-Id: 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=lists1p.gnu.org; Received-SPF: pass client-ip=5.189.157.229; envelope-from=fded2c648f0d39367ace49c7ce56433ec6c5ba70@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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1779300163969158500 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: sin99xx v9fs_co_readdir_many() dispatches do_readdir_many() to a worker thread that reads V9fsFidState's path.data without holding a rename lock. A concurrent rename request, e.g. of its parent dir, causes the FID's absolute path to be altered by freeing the old path string and assigning a new one. This causes a heap-use-after-free race condition while do_readdir_many() is still accessing the old object. This allows a DoS by an unprivileged guest user. Fix this by wrapping the worker thread dispatch block within a pair of v9fs_path_read_lock() and v9fs_path_unlock() calls, like it's done at other places. Fixes: 2149675b195f ("9pfs: add new function v9fs_co_readdir_many()") Fixes: CVE-2026-48004 Reported-by: sin99xx [Christian Schoenebeck: add commit log message] Signed-off-by: Christian Schoenebeck --- hw/9pfs/codir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index bce7dd96e9..5568399343 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -220,13 +220,16 @@ int coroutine_fn v9fs_co_readdir_many(V9fsPDU *pdu, V= 9fsFidState *fidp, bool dostat) { int err =3D 0; + V9fsState *s =3D pdu->s; =20 if (v9fs_request_cancelled(pdu)) { return -EINTR; } + v9fs_path_read_lock(s); v9fs_co_run_in_worker({ err =3D do_readdir_many(pdu, fidp, entries, offset, maxsize, dosta= t); }); + v9fs_path_unlock(s); return err; } =20 --=20 2.47.3