From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 209023A784F for ; Tue, 8 Sep 2026 08:09:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788854955; cv=none; b=SMdNWV7y8edUjF+lmIQ9YPMwLbVRNLRL8c80UK5pbv7vay9Wruq+SfAhXVeh0bkKfdaa28FULLAkSPyxhqssfRjWHnG2ekJ59o8jalz+z+fS9s35H3o+T+q9nIAWC9we00XQC/KgCVU2f+8SMF0A44Gwz/7JKK49kRQX6TjzMNg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788854955; c=relaxed/simple; bh=dTUl62Kvvwt2iA0jmSAM0I0mwQYi1Do7nzl5TFIuOkA=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=n4u79bbjC4d5zn/LPpsQcZVjfPzNwcj887RoHblnPVMbTRaux5CyyjI4wOOr9IduyLjceLAhOWyYzkvZgGQySlTy2L6C5cf+hYKgL/xkv+LOTd+uHtMYL8pJ2l7ZaJPpT2r+Nh13dkfj3XcfVuIJeJkzUD57K3jE7pOIDslsiSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=CHxwwz0s; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=vzS2YoE7; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="CHxwwz0s"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="vzS2YoE7" Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfhigh.stl.internal (Postfix) with ESMTP id 56E587A0104; Tue, 8 Sep 2026 04:09:09 -0400 (EDT) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Tue, 08 Sep 2026 04:09:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1788854948; x=1788941348; bh=LZo30iPxueLhaEWqWjWy7wIdR3qwNxI+4VleF/3GMuI=; b= CHxwwz0sTLz0k4JTDAir0E4LWkmAABV40cTbw0iHVtpW3jH26m9XhmhZgK0DcJVQ 3AO8q8rT5R4btuZsvUXga1Af7V2hgTufdVHCpB6C+uviqFvxonm/+LhmtVHLPvC7 LuN5fX3scXykkocuy4xZjxRwTWN5PdmwKlQ29GrItRbkNChjXskdvGpL01t+rgPk Q//MiteFc/irdpoDbM4Ko48zgRPkNudKn8u9ywO/bkCJnQ7W74h9/Pt1VuSQp47O xTWb2xozavabsaafUjI4EKIwZ7LaFf9XDFSCBoBrwI5xE1aTWzTeE6+adEpAnE7I +7VXEzu7NEN+3g0008p7pQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1788854948; x= 1788941348; bh=LZo30iP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20TnabwmGCCcGs8j1BB1W+VzD9t6D1YifQ X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id 830B032A0078; Tue, 8 Sep 2026 04:09:06 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AWdwJ18nw8go Date: Tue, 08 Sep 2026 10:08:46 +0200 From: "Arnd Bergmann" To: "Michael S. Tsirkin" , "Linfeng Sun" Cc: "Jason Wang" , =?UTF-8?Q?Eugenio_P=C3=A9rez?= , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Message-Id: In-Reply-To: <20260908035646-mutt-send-email-mst@kernel.org> References: <20260908-fix-vduse_dev_compat_ioctl-v1-1-62264d9bfb8d@gmail.com> <20260908035646-mutt-send-email-mst@kernel.org> Subject: Re: [PATCH] vduse: return compat ioctl results directly Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, Sep 8, 2026, at 09:57, Michael S. Tsirkin wrote: > On Tue, Sep 08, 2026 at 03:31:51PM +0800, Linfeng Sun wrote: >> The compat handler handles VDUSE_IOTLB_GET_FD and VDUSE_VQ_GET_INFO, but >> then calls the native handler. Their different command sizes make native >> dispatch return -ENOIOCTLCMD. >> >> For GET_FD, this overwrites receive_fd()'s return value after the >> descriptor is installed, leaking one fd per call. Return handled compat >> results directly and use native dispatch only for other commands. >> >> Fixes: 455a2a1af926 ("vduse: fix compat handling for VDUSE_IOTLB_GET_FD/VDUSE_VQ_GET_INFO") >> Signed-off-by: Linfeng Sun > > indeed, I will apply. The fix looks correct to me, thanks! > But ... how was the original patch working then? Arnd, what gives? It looks I either broke it during refactoring from two functions into one, or I just didn't do it right in the first place. I did write in the extra patch text | The code is directly copied from the native ioctl handler, but I | did not test this with actual x86-32 userspace, so please review | carefully. but obviously should have caught this one myself since it is a much less subtle bug than the one I was trying to fix in the first place. Arnd