Article View: linux.kernel.netdev
Article #3311Re: [PATCH net-next v4 4/9] tls: Consume empty data records in tls_sw_splice_read()
From: "Chuck Lever"
Date: Wed, 14 Oct 2026 18:12
Date: Wed, 14 Oct 2026 18:12
29 lines
8542 bytes
8542 bytes
On Tue, Oct 13, 2026, netdev-bot+sashiko@kernel.org wrote: > > [Severity: Medium] > The socket lock is held across the retry. If the peer keeps sending empty > records, how long can this loop keep lock_sock() ownership and the TLS > reader lock? For as long as a record is already parsed, the same as the loop in tls_sw_recvmsg(). Once the receive queue drains, tls_rx_rec_wait() flushes the backlog and then sleeps or returns -EAGAIN, so each drain cycle gives up the CPU. The cover letter explains why only tls_sw_read_sock() takes a count: its callers hold the socket lock across the call and never return to user space. A splice() caller runs in its own process context and holds only its own socket. > [Severity: Medium] > Can this retry make SO_RCVTIMEO restart with every empty record? Yes. The cover letter states that SO_RCVTIMEO does not bound these calls. recvmsg() behaves this way today. splice() now matches that behavior. A nonblocking splice() that finds no record ready returns -EAGAIN from tls_rx_rec_wait(), so a flood holds the caller only while records are already parsed. -- Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)
Technical Details
Message-ID:
<b65d8fde-c1ce-4543-ad3a-5e3819466230@slotpi15m67>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346383-linux-kernel-netdev=dewy.ruReferences:
<20261012-tls-follow-on-v4-4-8cea429565da@kernel.org> <179190790064.434549.9638297306862394280@kernel.org>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-346383-linux-kernel-netdev=dewy.ru
From: cel@kernel.org ("Chuck Lever")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 4/9] tls: Consume empty data records in
tls_sw_splice_read()
Date: Wed, 14 Oct 2026 14:12:28 -0400
Organization: Usenet Network
Message-ID: <b65d8fde-c1ce-4543-ad3a-5e3819466230@slotpi15m67>
References: <20261012-tls-follow-on-v4-4-8cea429565da@kernel.org>
<179190790064.434549.9638297306862394280@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="2357121"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/yxY7yOBhC3t6Dg5SdmvlwgbYFQ= sha256:cpCCE8TKQ+nHdXMaIWAHIk05RP6MoPAHDIEg8Hcml6E=
sha1:8E6E89Z2DmnwTyb7NN8IMTtcr9Q= sha256:ZlnCEtRp5Y/au64kvgZ+Ou7GV4c5qDr3LL9/AqhvqJg=
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 94B8C11018D; Wed, 14 Oct 2026 21:13:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.339
X-Spam-Status: No, score=-1.339 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=kernel.org
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 YTD3ZGlMcYtd;
Wed, 14 Oct 2026 21:13:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-346383-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 29E9711017D; Wed, 14 Oct 2026 21:13:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id DAAE827852; Wed, 14 Oct 2026 18:12:52 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id ECB0E563FCB;
Wed, 14 Oct 2026 18:12:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OleNOUmV"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
(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 E9BD75616AE
for <netdev@vger.kernel.org>; Wed, 14 Oct 2026 18:12:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1792001571; cv=none; b=XCmjKx/LGKgZ00rjmjVbvm2qBnmiug5lJ9EmCp4sZ4zMLFq/VnHDI3Jf32dMVmqaSZUeA9aer3QahrpDtDkOj0NxyEIhTkpvyRIrFvwQlb7XUgXWtI8fAl/pF3HlJTD/ahwIozMDeEchOjIrHfwfUXON8vo1/hpAiayynUeIZMw=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1792001571; c=relaxed/simple;
bh=Xc+lRHZy2ZJ4991Q8MS/zZxpXGn8qh1AmNhbt/Uit+I=;
h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References:
Subject:Content-Type; b=HoSMS9c0g86Bas/KijtVt90WpfQ2kMs9XWYU9addGpoCGjNlt551Qzi7Ek5nw49WaZqWZUB8AIcZtfEBOBhrLFfjrI5berJGiRdxqvU0MEgCmR3wqro6rq3f9gkkAwAHeCTBWd4nfpTQBpujs/CJaPF5+4dB/DL1U+Q6xtyM2UU=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OleNOUmV; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49CA41F000C5;
Wed, 14 Oct 2026 18:12:50 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1792001570;
bh=NR6A5LL9yOdOhxWXqJxESp6Cj2BKsSk6ZBcEvw4P39g=;
h=Date:From:To:Cc:In-Reply-To:References:Subject;
b=OleNOUmV/Fqxy5BoxBAw5vXTeB2h08rQoV1qp4qxj2rqzucZBnm1Kz3jR/j54ufoP
SQZsM/p5yKRomMupOjGUGvpPEQ9RAsMVaZCLNtQ8fYvuVOVdFtW2O9HvZsO2UC5zKc
92YnN/OO0eWBO1q7n4ms2ACJ/j0N/jvoWEmlcdX24U4rXJLgr+uShgEN+KS5ul13sv
hS1CQnQidoxCDAvXaypyREcogTxImrqaDMu6W+RruFRWidf7Sa38LK5mMMK9d6qpKH
HwxBG6ezO1doTG3XTl1bOgP22byL8+gHDkD8X/Yxg4AymJ+tG77v84ao9QFnSutOcE
++2Uo3kaw+Rng==
X-Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50])
by mailfauth.phl.internal (Postfix) with ESMTP id 9BF8AF40066;
Wed, 14 Oct 2026 14:12:49 -0400 (EDT)
X-Received: from phl-imap-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rFfVnRlL1aawHsbkgvR03ElOlQ>
<xmx:IcbPaq6WN62wLaI1aV3Mnoth0AEaFtbmrTbWy3HmNuyfE3aLS7bnuA>
<xmx:IcbPanlvORycPlgozLQwmpBjcgPU6ukqoo84g3-lKaq4ndqgdBTDAg>
<xmx:IcbPaiF6nhc8wrshPM0i8IqhclMlaiNnuyw2owQ2nNrh6pUTJGdBDxg1>
X-Feedback-ID: ifa6e4810:Fastmail
X-Received: by mailuser.phl.internal (Postfix, from userid 501)
id 7C91C782738; Wed, 14 Oct 2026 14:12:49 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-ThreadId: A5NHe7wxkV1V
X-Cc: john.fastabend@gmail.com, kuba@kernel.org, sd@queasysnail.net,
davem@davemloft.net, pabeni@redhat.com, horms@kernel.org, davejwatson@fb.com,
shuah@kernel.org, qingfang.deng@linux.dev, edumazet@kernel.org,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
X-In-Reply-To: <179190790064.434549.9638297306862394280@kernel.org>