Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796135586; b=BLi0XsUSikyjpzWlWgHYpUBK8jdGkdr3cRkJsS7dDRum/kJhzjOK8yHPGX/cg9hxpINN k4tlTv176JnmlynN1I0uE1wfSey0HrHMO8qA5b2BerN2i9ObPy6Dkt6kQOucBzMHWD/3F LKaR1a3L9XnNEDP2F2Ir+eB17ut0Y/qFpBGqO9zxbMKUxfm/RSHH1NuVeBskungfptzu4 PV+4Q7zY2q/FXXEWSCAut3tqBYWGy9rfgidFqDlTrK3lBc9+11Bd4Hluycr89n954zcVj K9FobG++urrHIJ42o7uOE05QnCbgnoyynv/38HN8jQ1wvIsgHc7hNioSqKmxAV/7Stw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796135586; h=DMARC-Filter:DKIM-Signature:X-MC-Rep:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To: X-Mimecast-Spam-Score:X-Mimecast-MFC-PROC-ID:X-Mimecast-Originator: Content-Type:Content-Disposition; bh=IhLvXTKsx1Y4ireDl09EupnV+h5onqnVVhoGZnF0oSE=; b=MAIFbp/fH13dx458uNjcqxrizElvFUvXuMRPQkzlW4zctNlvJebY/Q5sTHAG6QTj1UJn q0A8bWVrowde0ZcMib7EGxST2YvY0E1+qE/67BQm1jKUhIIZqhTXNwwxXpiLHOUVtrcM7 9rva+FOZN3Wm+W3tM7ZW7h2k83Ria8LHbueFqpsUVel/GWHwg2x2TqlWIJCGR61uqq/3y VBQb8QakPsRL3CbW+RrQ6d2e7nafPF/WbQCENaNoQJ2JnQu0oEQwPBm27bSp9VT4FkpAH Pr8CLgZNHmfb2P/XsjqcSeGpVYqV1SSa8wO82WYCP7LceuJZuVpXwgcSv531BpIYQjg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ArEU4nKP; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECADA606A320 for ; Tue, 1 Dec 2026 14:33:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ECADA606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ArEU4nKP DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796135584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IhLvXTKsx1Y4ireDl09EupnV+h5onqnVVhoGZnF0oSE=; b=ArEU4nKPb/I9s28YFX0tnxhq11zqxAMsDEoHzvS706iI3L9Thxu05OqeFecTzSKLkthyGM 6L9oO/f42d2BA37/FjYR1WQDlP5Dl4JydWQ5EvNwEup4RSVOIENdSelCQmBa2Y03AySOph 6U5tmOtvpXPz4r7goCJ+Ryb5SF2u71E= X-MC-Rep: binary re single Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-497-xXTu6Ik-PRyZVcROld581w-1; Tue, 1 Dec 2026 14:33:02 +0000 X-MC-Unique: xXTu6Ik-PRyZVcROld581w-1 X-Mimecast-MFC-AGG-ID: xXTu6Ik-PRyZVcROld581w_1796135581 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4a0284121c6so39824575e9.3 for ; Tue, 01 Dec 2026 06:33:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796135581; x=1796740381; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=IhLvXTKsx1Y4ireDl09EupnV+h5onqnVVhoGZnF0oSE=; b=slK3oooA2t6Ruhu/yvxzGWs0v7EHnNpEDrLq0KKIO/49pVsuDsLa9CI1+nHoJWDbmC Vw7tJSv04gAHwM5a1OWYE3RgSA+v0SOnsEKnZCugRj0JrLhzO1fwdYlf+IVh4NVQWYwt ibMry+xA3lEFChEFdSyjiEppWa9BayCWpkJa0MqMfngyvBF+/0GNUF5SuIeWLX+0n2sB +teFhq6pX5st4Ra8TATFZCTND0QIJ/CI1OTbxBHnqoWBGLLfU0GNu1qxJGI6bwqZgaoF GqLyxbFz/tb0dCQXPDpAGIlQHO4pAPQprv0o2vkgaWri2l/qQ22dI5W+UnEfYhtN9Zik 3dng== X-Gm-Message-State: APuU4Z8e4MosMenJK9D3TNvRKj5u4HiaYNap/ZG0+IXl/YwscLyrGDtV vraObF/p0s927kwPSGFkxuAVFy3D7n7Ws51My6X7yXYI9XsvTQ95SQtfen4H7IeSYu3fC6CLJU6 oC2NYjiyqw9XL1okgM06hBNgBMJZ92Q81R7AaXFeloy3J8D4uKr+ps4yAgFRwxHUc7GoC X-Gm-Gg: AZFdTZeKZGGPSaBu861b88yMxSXwuniozVJY/w3Iu+G6nI+WgZrfOUwpRbXBtIdGZtq zIJywpHSekMvdmAKx/LSOqxGjyFMw2mgh0E+ceIe820lva9010i2gogMbrHNNYuKC5QuRyXgIjY sxOWkIKQUIikc0/sjKB2ObsUvZTnRZ7uQ5fYf8b9D4CSZjGsslOL9fzK3fypS92Kb84Q+CsSjIv /jmj/ZYckkhF3Lab2yuotJadpFVEKhSAt95v+qG9ONvmhXqEdRM/z2QibSxj0h0Qp6D5BurgakF qOM97cqKu4ILt3Ky95BmvF7cX+xNLtkwZxseHOJ6Lvgqr8MKJTmqiwTkqWrEQPV/xwHFJfcIGlQ L53NrzikWI9Usp1HEICXDg8+fQQxLFh9EKvLNya3GoiQOxyyg+G0+LyqFf6KnI1CSEydGUMpYo/ 0e1WxGkwVhtoCmxQ== X-Received: by 2002:a05:600c:848a:b0:4a1:fbd2:f689 with SMTP id 5b1f17b1804b1-4bb8880993amr697287015e9.7.1796135581380; Tue, 01 Dec 2026 06:33:01 -0800 (PST) X-Received: by 2002:a05:600c:848a:b0:4a1:fbd2:f689 with SMTP id 5b1f17b1804b1-4bb8880993amr697286215e9.7.1796135580767; Tue, 01 Dec 2026 06:33:00 -0800 (PST) Received: from sgarzare-redhat (ip190-139-192-82.pool-bba.aruba.it. [82.192.139.190]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6bb989eesm70894724f8f.50.2026.12.01.06.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 06:32:59 -0800 (PST) Date: Tue, 1 Dec 2026 15:32:55 +0100 From: Stefano Garzarella To: Ren Wei Cc: virtualization@lists.linux.dev, netdev@vger.kernel.org, bobbyeshleman@meta.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, arseny.krasnov@kaspersky.com, vega@nebusec.ai, caoruide123@gmail.com Subject: Re: [PATCH net 1/2] vsock: preserve receive timeout across partial reads Message-ID: References: X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 25U_a8MYYexgJmaLxEO5hQECTlEYqPmXjg6gw48RF4M_1796135581 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Nov 27, 2026 at 01:19:13PM +0800, Ren Wei wrote: > From: Ruide Cao > > __vsock_stream_recvmsg() passes its receive timeout by value to > vsock_connectible_wait_data(). schedule_timeout() therefore updates only > the helper's local copy. After a partial dequeue, the stream receive loop > calls the helper again with the original timeout, allowing a peer to > restart SO_RCVTIMEO with periodic short writes. > > This was found with LLM assistance on the Vega platform and reproduced > with the platform PoC in QEMU as an unprivileged user on > VMADDR_CID_LOCAL. recv(MSG_WAITALL, 6) with SO_RCVTIMEO=1s returned 6 > bytes after ~4.8s while the peer sent one byte every 0.8s: > > client: recv(MSG_WAITALL, 6) returned 6 after 4.816 s (timeout=1 s) > RESULT: bug observed. Finite SO_RCVTIMEO did not cap total wait time. > > Pass the timeout by reference so the remaining time is retained across > partial reads. This makes the receive wait budget cumulative without > changing the existing blocking behavior. The seqpacket call site is > updated the same way; it only waits once, so the change is mechanical. > > Fixes: b3f7fd54881b ("af_vsock: separate wait data loop") > Cc: stable@vger.kernel.org > Reported-by: Vega > Signed-off-by: Ruide Cao > Signed-off-by: Ren Wei > --- > net/vmw_vsock/af_vsock.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) LGTM, thanks! Reviewed-by: Stefano Garzarella