🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6859

Re: [PATCH net-next v6 1/9] tls: Bound consecutive no-data records in tls_sw_read_sock()

#6859
From: "Chuck Lever"
Date: Fri, 23 Oct 2026 15:15
34 lines
11357 bytes
On Thu, 22 Oct 2026, netdev-bot+sashiko@kernel.org wrote:
> [Severity: Medium]
> Can this break return 0 while the next record is still being parsed, with
> nothing left to wake nvme-tcp?
>
> data_ready_work is only queued if msg_ready is already set. For the 16th
> empty record, tls_rx_rec_done() calls tls_strp_check_rcv(&ctx->strp, false).
> If tls_strp_read_sock() returns -ENOMEM, the parse is handed off to
> strp->work and msg_ready stays 0:

Agreed... but the gap it leads to is not one this patch opens.
When the strparser defers a parse to strp->work, tls_strp_work()
announces the record through saved_data_ready alone, and a
read_sock consumer that installed its own callback after the
handshake never hears about it. That is reachable today after
any record, data or empty.

What the cap changes is the number of allocation failures that
reach that state at one point in the loop, from two to one. Both
need GFP_ATOMIC to fail during a run of sixteen consecutive empty
records, and both end in the same place. The fix is in the deferred
announce, so that a parse completed by strp->work reaches the
callback the consumer installed. My preference would be to fix that
as a separate patch so it can get backported.

If netdev maintainers would rather have the work item queued whenever
the receive queue is non-empty at the break, that is a one-line
change and I can send a v7 with it. Otherwise I plan to leave this
patch as is. Let me know.


-- 
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)
Technical Details
Message-ID: <7d69b735-fa5c-46f2-bfe8-38937380fac9@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-351136-linux-kernel-netdev=dewy.ru
References: <20261019-tls-follow-on-v6-1-ab01c4ecca0c@kernel.org> <179269905526.1189532.975361221217060549@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-351136-linux-kernel-netdev=dewy.ru
From: cel@kernel.org ("Chuck Lever")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 1/9] tls: Bound consecutive no-data records in
 tls_sw_read_sock()
Date: Fri, 23 Oct 2026 11:15:09 -0400
Organization: Usenet Network
Message-ID: <7d69b735-fa5c-46f2-bfe8-38937380fac9@slotpi15m67>
References: <20261019-tls-follow-on-v6-1-ab01c4ecca0c@kernel.org>
 <179269905526.1189532.975361221217060549@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="532603"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:9pwQiy4bXaNebinI47eX4kDRpKY= sha256:XCon4EdVG3uP7RDaCScL2ZLj7ytJELxpkOlExVGQtZU=
	sha1:wniCKnQEcMC2D+cZGbWRztLK/jo= sha256:zb6SihuaH/K4sCBy9ER2cgCPMfCwsbHdFljDcSHapsw=
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 BB393111503; Fri, 23 Oct 2026 18:16:54 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.839
X-Spam-Status: No, score=-3.839 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-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 55JVVPSbbTtk;
	Fri, 23 Oct 2026 18:16:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-351136-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 6769D1114FC; Fri, 23 Oct 2026 18:16:38 +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 33A8A608B3F; Fri, 23 Oct 2026 15:15:38 +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=1792768537;
	b=tyR+ZFOuy2DkLXrs4zMK6WaX3xUkqyJnRHAm/5jEU2j9P5B8tVxv9ljyYbOSL416J/99
	 lG1qsRcqJRnr2ekIR2SIc7X51YZla1sDnLsjAiSxoqdk/SlqZlz9VGnNRm4bL10qrBJTg
	 8D6ZHpowMX0m9x7ifHuKva/Bbv1BcYNWELx4JQguZGg2yE6DHWql9cku0cuuFabgTHN+A
	 O/l4T/GMVRBrtY8h0iDYRi7Vs4k6Ek1Z+/BdHsw3vK0steS+MM7SOquMHMUvXeMvS6bn0
	 Jp3vzdcpLgCGAKACeMzY5lckTVfVtf2myBNjSK7rXl2XG7gerSBHM/kBmyBzpTZDccg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792768537;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:Received:
	 X-ME-Sender:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:X-ThreadId:Date:
	 From:To:Cc:Message-Id:In-Reply-To:References:Subject:Content-Type:
	 Content-Transfer-Encoding;
	bh=n3iOAGlkC+FkFfz7XihQCahJx8tfVvvTkUKXRSo49zc=;
	b=zY5IvgK2keuYRa7VRD40gOBx+58gCPisnc5KrSF/kZV6JZlEtl6JQylF5Mb15kRFMzb4
	 XbRZMuXIcbzanM0np9Fd6ol3Iaek9fSqe6QtSOOIXjeg36UXK1L2N29o2vY3y1wYDZ/ul
	 EhzHLJfhoERi6da6+ld/jL8x7DtUYr9lmYgSlzJW6xbqMlpuYLm7Tvpc9HmbOBEy9zUdO
	 eRBb6xpYrpeB+NimpxvdK0PC7Z4C6Byu1WQA95r4cS1TJEKlVaiMeXFUmriZ2BxRQWgZr
	 3otwvygwGrplUIvMgvQznZUVpx6V5QgFBOZJr1BKTtfFFDxcqx+WWAVE/7MkDGtmkKg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Gimej7v1;
	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 27F02606A322;
	Fri, 23 Oct 2026 15:15:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Gimej7v1
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792768531;
	b=PIGcAQapcMmaX7J29J5n7/ecNTS7eu/sHf98XEUBnrw+J+VtxjrrSTqzlYsPGjUesnkw
	 kEwZkkj0cZGCeDvHGkWhl7cQzZWC1ByPRDYgq5Gc7u2t4zfhUm3BG4TAE7gdbTiExFeYV
	 yIhS/pW9e5H0kRTVuV9V388XIswxdFkot2kTCVWh6bAsCfUZTQ3w5fT1hNyqI1eEDpnua
	 BHfyVZvr6O9jRFfH7SjR9SqmNeBsjJkToqr5EkchYy0eF/ziByR4jQg8/baDcO2B5NIZE
	 KVruJL6oEVcb8ujPfxZDmCNS3yzwcPHUMsy6K2aog/t4INS6EolaueGphsjMt8HS+Mg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792768531;
	h=Received:DKIM-Signature:Received:Received:X-ME-Sender:
	 X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
	 MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To:
	 References:Subject:Content-Type:Content-Transfer-Encoding;
	bh=n3iOAGlkC+FkFfz7XihQCahJx8tfVvvTkUKXRSo49zc=;
	b=GV/Gqma9Rl0QGu53xrKQzPP2f+GfcUKS7gzJipyvzrPJUzT+crSLxw414S9X4mnKaZsM
	 DQKWow7WKLfn09fiN6kXd4RygHYzVA2Y/0w0Bm4E6eJv2Obyz6NZqsDSJhe3OuAMxMmLZ
	 l5jRMJMELnrOk4dWNhWOSFXdFT86VM3yMgzSqhhZiD7oWEedSAZtgAtrCuitIA3Rfzmxd
	 /jnC7HMbNd28L2eI0nIpXUz2IzVD/Bo671b8sD+LUMMc6BXJxN65+XBho/8RAKpPz/87J
	 ZyY1UF157RTzLU7D9ptgt+SX8AuJ+zg55b6G/KjrDrWftln0MlfEHnjQvY1jC/o/5AQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Gimej7v1;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0891A606A320;
	Fri, 23 Oct 2026 15:15:30 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 543A31F01828;
	Fri, 23 Oct 2026 15:15:30 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792768530;
	bh=n3iOAGlkC+FkFfz7XihQCahJx8tfVvvTkUKXRSo49zc=;
	h=Date:From:To:Cc:In-Reply-To:References:Subject;
	b=Gimej7v1/v0wTVFvdHlRJmhJ49fClgopyax8GXVSXvHnRSOfw50gzDVrgB8yBKbTb
	 RS3/6YhUFALci5Co/9F+qsp4Otm3WhFl33244lp1KnxtGJS8rdWulhB2V0aFxJmkc8
	 81lqf6uND1CL2WhFbqlzLKtlBqf+QHA792v/UtKFGS4258lTKitDJ6U0SA+TtgL/j2
	 0ypYIu/floTOKkWFoQ9wcZllkh3q24U7fY4p8+MbRCe96ND+Ig5KQjC2jVj92YRCV1
	 8EVWtb+6vC/92PrlOPNcCNv/1J6w26tejCbI6U4SUZFvy2ihh7tCJAsFS9WJVRef4h
	 nbsnxzaIT4GVg==
X-Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50])
	by mailfauth.phl.internal (Postfix) with ESMTP id 9DC25F40066;
	Fri, 23 Oct 2026 11:15:29 -0400 (EDT)
X-Received: from phl-imap-15 ([10.202.2.104])
  by phl-compute-10.internal (MEProxy); Fri, 23 Oct 2026 11:15:29 -0400
X-ME-Sender: <xms:EXrbakjJY7UgDwJTKbZNF4ElmfvH9fABOChRxQYSzQScP-Udl1XgKg>
    <xme:EXrban03Qrw0qUVcDR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JhE0VKAYeA0UnA>
    <xmx:EXrbard8T-IUICBdQwT4m0ELVMPf7RjtrCZkC-V2p_P5ClY32gjYVEiZ>
X-Feedback-ID: ifa6e4810:Fastmail
X-Received: by mailuser.phl.internal (Postfix, from userid 501)
	id 7BC8678273C; Fri, 23 Oct 2026 11:15:29 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
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-ThreadId: ApVy2ZgDP3UR
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: <179269905526.1189532.975361221217060549@kernel.org>