🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11091

Re: [PATCH net v2] net/smc: don't spin in smc_rx_recvmsg() while a pipe holds spliced data

#11091
From: Dust Li
Date: Wed, 04 Nov 2026 17:00
31 lines
10080 bytes
On 2026-10-29 03:03:33, Bryam Vargas via B4 Relay wrote:
>From: Bryam Vargas <hexlabsecurity@proton.me>
>
>While bytes spliced off the RMB are still in a pipe, recvmsg() waits
>for the pipe to release them before it copies the data behind them.
>The path to that wait skips the timeout and signal checks, and
>smc_rx_wait() returns at once on RCV_SHUTDOWN. With a signal pending,
>after SHUT_RD, or once the peer closes or shuts down writing,
>recvmsg() spins on a CPU until the pipe is drained, and SIGKILL cannot
>stop it. MSG_DONTWAIT and an expired SO_RCVTIMEO wait there too
>instead of returning -EAGAIN.
>
>Check the timeout and signals before that wait, and end it when the
>pipe releases the data or the connection is killed, not on RCV_SHUTDOWN.
>A zero-length read returns 0 without waiting for the pipe; a
>non-blocking one returns -EAGAIN while poll() still reports the socket
>readable (splice() can still take those bytes). The wait sets
>SOCKWQ_ASYNC_WAITDATA like smc_rx_wait(), so a byte arriving behind
>the pipe raises no SIGIO on a reader already asleep for it, and a full
>barrier orders its wait queue entry before its read of splice_pending,
>so no wake is lost.
>
>Fixes: 9014db202cb7 ("smc: add support for splice()")
>Cc: stable@vger.kernel.org
>Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>

Reviewed-by: Dust Li <dust.li@linux.alibaba.com>

Best regards,
Dust
Technical Details
Message-ID: <autkkxC260Mq--dx@linux.alibaba.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356620-linux-kernel-netdev=dewy.ru
References: <20261029-b4-disp-da7f8e6a-v2-1-9052904adf72@proton.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356620-linux-kernel-netdev=dewy.ru
From: dust.li@linux.alibaba.com (Dust Li)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] net/smc: don't spin in smc_rx_recvmsg() while a
 pipe holds spliced data
Date: Thu, 5 Nov 2026 01:00:03 +0800
Organization: Usenet Network
Message-ID: <autkkxC260Mq--dx@linux.alibaba.com>
References: <20261029-b4-disp-da7f8e6a-v2-1-9052904adf72@proton.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3436634"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:WTLjvDFxQRIPVrHSKiujcBbfyxc= sha256:ndIL4Smsj5+EwK2OWOZ+Rogpi4bPxnRvNY74vhMtluk=
	sha1:/7dK3ieOfm2/CFZMSJrJGz0kbQE= sha256:fP5uBdFgg5gEwNMjxyJv3DirdV7R2sygN6bSpN4KhkA=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 57C1B112C78; Wed,  4 Nov 2026 20:10:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -10.65
X-Spam-Status: No, score=-10.65 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	UNPARSEABLE_RELAY=0.001, USER_IN_DEF_DKIM_WL=-7.5]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.alibaba.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id yYHP21JQfr5H;
	Wed,  4 Nov 2026 20:10:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-356620-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id DCD1A112C6D; Wed,  4 Nov 2026 20:10:31 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 4576C6132E2; Wed,  4 Nov 2026 17:00:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793811616;
	b=y7Caf3Dd6QlbjXK//ydoJoXExOp9IT62OyQkXZ7fJEOm+fQ16uda/WfcgVt67gockeD/
	 RRlZFKQNUS5OP66kt+uN8yihT0KH9JqWsTIkynXdmD2HskgOzwFiPuwVFKdwW5Eoghydb
	 13mkJROf5FLypyCgCnLpIH4Q2KFjbc4NtQMm+EVmmQmzqD0KPBOJuZ8FdUcoFsLVk8TSc
	 dg1eTfI2W3xx8Vu7yKVK7E6PN1u4Fygl/Ab7w7+b92cKbbzK2cwPLEanY53BBDPD3SOC5
	 /eBU5Kn0SnqmYA+0P6+JZUmyn4ojE9eQjUe0Vl0x5KDf0zxiOfjQPIufOTWzuJy+enQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793811616;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:
	 X-Alimail-AntiSpam:Received:Date:From:To:Cc:Subject:Message-ID:
	 Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To;
	bh=rp3ZfEOvoyj0AGyhtM1kMEKo3y4yYvcAsluSoIw7ejM=;
	b=Wzbxvn7q5I1aGlN6qvC86Jqw9SteQEAC4SlefwnnUSTV/TVsujf9difmlnxPcvNHu507
	 7jtkOPNhsH36BFmlAy+xbQi7IXEFfBVne1EJo0QwZ8pLM8w1y5oISFIvwdAk0w1V/K/bf
	 jJrllZY1c2uHkFdsT6mG+l1FXf2MYhR88BVwBLlkb0BoE5yG0m5JRZ37nkAkLC+Fq9Vt/
	 o/z6uphNhI4qQgmo6Vahz4Pfs6rLatdWY7zlrNteUoWTPUrLOOPVHdhZEeZKURCy6l99u
	 vNjEiZXAWrejnj+lTFtQTluCUyyooYgm5EdWPiRqt36lL2U6CPabJfHVyEakqpF+5XQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=BfDMXCKG;
	dmarc=pass header.from=linux.alibaba.com;
	spf=pass smtp.mailfrom=linux.alibaba.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 159C8606D836;
	Wed,  4 Nov 2026 17:00:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=BfDMXCKG
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.100
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793811615;
	b=yY3OHpZOzUEmGrq9oA0bOgu5sKYEfXtJ/Snlk51LdHU4OAFMXO8Gz7lnihrMJIZx0t7M
	 HiN2kX0ah4JvNS8kIQiBhfIyQ47X9n8yYcnZ95klXEAelKD48jXlPb6KHeKgIyTaTqEQV
	 jmh6PaRvWHF3nhQmIgFXCUW81Z+oLR6PMBImOkMi4uFA2fn5UoouIYTh7dQmFNAoFQIUu
	 73vynoXPB5v/y2po9j1ZPoenWaA3Q5BSSbBVWs56sIvv105THEocKUIK4pX0CTPoet0DC
	 dD1anfwm3cQweGfqlqNKTCpg8Tj7FZ9QDlgQ1D/LMzDGefj64m/bwmGgK/UejfzHduA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793811615;
	h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:Date:From:To:
	 Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:
	 Content-Disposition:In-Reply-To;
	bh=rp3ZfEOvoyj0AGyhtM1kMEKo3y4yYvcAsluSoIw7ejM=;
	b=aEn1/1ZFyWEpweh/sq7cVxOK/Ya2y5k5J54i+boDF/3EtGx/d3hYKAzR+krwFhYkMirG
	 4oJ+WuzFTEOULmdIBY4Wpvm6ohx9vLVHSl2tJuuHShmhHp2k5euaE/JrEMJACOLz9tkkf
	 GfzrImw04RkhloyGd5cIKYb07+ugCcOjcHxNTF3ra1RsgmD9vb0I5ZxsHCCJXSx2bAy/W
	 KeQmTt9Okr9eSTdkKIRxRu8KhMGJyaIei1tiDd0HMAgL/HLHb4nqBOR1olVVuCbocKKxc
	 UsVjhDOj011118ybmtR3u5o8ZMVWYcjGRy0e2cm9UFMPl0juFKCm5NurTpKdDaC+jVg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.alibaba.com;
	spf=pass smtp.mailfrom=linux.alibaba.com;
	dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=BfDMXCKG;
	arc=none smtp.remote-ip=115.124.30.100
X-Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100])
	(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 7A847606A32F;
	Wed,  4 Nov 2026 17:00:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7A847606A32F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=linux.alibaba.com; s=default;
	t=1793811605; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type;
	bh=rp3ZfEOvoyj0AGyhtM1kMEKo3y4yYvcAsluSoIw7ejM=;
	b=BfDMXCKGapvcKcVwLRZU7SJJ4SmFMa9bhjrYPlJ/QH1XdVrgH9KxlUvPTbyFheju/x1O6C934rQJZOf0ieH9xeVSWy5GQiYmg+2AuC9oSRfZYxUk6e5N2kMCn/w4pDAQX+3pQOcic0tMSUTm7zh/L6yZ6TLHggbL51/vt2NsGlY=
X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045098064;MF=dust.li@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0XE6E8un_1793811603;
X-Received: from localhost(mailfrom:dust.li@linux.alibaba.com fp:SMTPD_---0XE6E8un_1793811603 cluster:ay36)
          by smtp.aliyun-inc.com;
          Thu, 05 Nov 2026 01:00:04 +0800
X-Cc: linux-s390@vger.kernel.org, Wen Gu <guwen@linux.alibaba.com>,
	linux-rdma@vger.kernel.org, Tony Lu <tonylu@linux.alibaba.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>, netdev@vger.kernel.org,
	Stefan Raspl <raspl@linux.ibm.com>,
	Hidayath Khan <hidayath@linux.ibm.com>,
	Simon Horman <horms@kernel.org>,
	Ursula Braun <ubraun@linux.ibm.com>, linux-kernel@vger.kernel.org
X-Reply-To: dust.li@linux.alibaba.com
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261029-b4-disp-da7f8e6a-v2-1-9052904adf72@proton.me>