🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6863

Re: [PATCH net-next v6 2/9] tls: Check for a pending signal after an empty record

#6863
From: "Chuck Lever"
Date: Fri, 23 Oct 2026 15:18
48 lines
11903 bytes
On Thu, 22 Oct 2026, netdev-bot+sashiko@kernel.org wrote:
> [Severity: High]
> Does this close the hang for callers that never receive a signal?

The cover letter scopes the count bound to tls_sw_read_sock() and
leaves recvmsg() with the signal test on purpose. I consider
addressing the hang as out of scope.


> Two kinds of caller appear to still be held for as long as the records
> keep arriving:
>
>   - nonblocking readers (MSG_DONTWAIT or O_NONBLOCK) with no signal
>     pending
>
>   - in-kernel callers that do not take signals. One is nfsd threads, via
>     svc_tcp_sock_recvmsg()->sock_recvmsg(sock, msg, MSG_DONTWAIT) on
>     kTLS sockets (there is no allow_signal() in fs/nfsd/). Another is
>     rpciod workers, via xs_read_stream(transport, MSG_DONTWAIT).

Both exit through tls_rx_rec_wait() with -EAGAIN as soon as the
receive queue drains. The hold lasts while the peer delivers
empty records faster than the reader decrypts them, and that is
the behavior these callers have today. This patch narrows it for
the callers that can take a signal and leaves the rest where they
are.


> Could the run also be ended for nonblocking readers? One option is to
> return -EAGAIN after an empty record. Another is to stop after a bounded
> count, as tls_sw_read_sock() does.

An -EAGAIN after every empty record returns a readable socket to
the caller with nothing copied and the next record already queued,
so a poll-driven reader spins on it. A count bound fits read_sock
because a zero return there means no progress, and a work item can
call the consumer back. recvmsg() has no equivalent return for a
blocking reader that has copied nothing. The in-kernel callers hold
the socket lock across the run and cannot take a signal, as the
cover letter states. If a bound for them turns out to be needed,
it can be made as a separate change with its own Fixes: tag.

I'd like to leave this patch as it is.


-- 
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)
Technical Details
Message-ID: <1f61d167-cc15-4720-bfc5-5db3d27e064b@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-351137-linux-kernel-netdev=dewy.ru
References: <20261019-tls-follow-on-v6-2-ab01c4ecca0c@kernel.org> <179269905670.1189532.10172561334611048258@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-351137-linux-kernel-netdev=dewy.ru
From: cel@kernel.org ("Chuck Lever")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 2/9] tls: Check for a pending signal after an empty
 record
Date: Fri, 23 Oct 2026 11:18:18 -0400
Organization: Usenet Network
Message-ID: <1f61d167-cc15-4720-bfc5-5db3d27e064b@slotpi15m67>
References: <20261019-tls-follow-on-v6-2-ab01c4ecca0c@kernel.org>
 <179269905670.1189532.10172561334611048258@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="535928"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:l/h9mQyZqIa6QDS0QhhO0XwAwcs= sha256:TPP+frVbdIDlyfQ1qnpZcUM7KkJe0Cbjw/dpeBu0zPQ=
	sha1:ItEi2SNI34kiE7KQyATGYEM554Q= sha256:jrVWnLoWJYYa2qzWHmiG3MD8B9SHF9kKZZn9d5z1j5o=
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 30BE311150E; Fri, 23 Oct 2026 18:30:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.738
X-Spam-Status: No, score=-3.738 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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, 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 jxpYTAjlEnvv;
	Fri, 23 Oct 2026 18:30:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351137-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 1C0981114E8; Fri, 23 Oct 2026 18:30:35 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id DB39836DD0; Fri, 23 Oct 2026 15:18:41 +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=1792768720;
	b=FB2AWoMi9n09awM2pnTFqexLc0+/Ub/scPbuUcxjd/0DmmNkwR2GvBV8Gs4p9ZNBXZ7p
	 L8fyMoeARWP8LweT0HV7g+Q4w0i/4CnbwEK4UudmAqTgmq9j6TpQP9EJa86r8yBnkY7Ko
	 bz+Un6m/TNgz49XFtYG/FlDR0Io/BMej99S6JzJzN42f62TVmxcu0BcR78c43NBRl1U7o
	 QAY5Swwlk8GgOs/Ib+UG5c7bzEEFTCVTx53mhi2/i0/EWntD+3q93YgJSk9LtiM/gnrST
	 cNmTR4GXTYAuoySf+sVEXGvfcfDmnoVrKb4FViSJa1FXHqONF7ecQgmML24vys9+z2A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792768720;
	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=t8taL8edTQg/YBtvxE6kIr3WTjB4jdlSUIYz98fZHsc=;
	b=E/kZEzRH9urMnpt4EuqR3s2XLRNoPYXrmNYejBHEGL6PPlCX/sJ9MvqFbUI6AjVDNxI7
	 m/0r9r12PiwmldT7w4crTqv3yVatkJkCbavV0DJHHiD11MMzwezLSvzSJjcNm0kjrCpLu
	 nRhlTRdjfFlLU2r1zABDDozlyd6E5ctvIlzevi4R5GbleLaAqKAAyA0X2P90nzV1y+2Wq
	 9yAbr8LvHKTQ+OYZmvETFBHEX9QtZJJoTbFI8S9XT+CUltXqFmoUMV7HRHE5LJDkBMbBn
	 MZDLPDXDpxnmyKdn1Y+Vh/ucMVTstPSMeJh0BLI82MB7G4DmWAvxyQLa4Ro+NPvUdUw==
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="bk2u/FkC";
	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 C3E5E606A322;
	Fri, 23 Oct 2026 15:18:40 +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=bk2u/FkC
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=1792768719;
	b=g3vNTFKIsAtCh5lTJSFKR2clsjnRDpIoAh7LdkCbXEaCSZS6wZcO34F1YM1g2qBqBKiJ
	 GbsQ46/5BDtA9nTTbc9dhxNw6DofoIU5kKDf57DSeeJ+8ABUyYy3pcZ98STHtKsucLMTN
	 JxfVpmR3ojybFdkIL5UHVGI6lStLRcq/lIy7Mp2McdtivYUwlp45HeCFDdm7oL3DWDLTE
	 BMujb+jVMkoZTU4Nzv2ci83gF6ooDgDKdu3UgxynuDLVA6V8Qu22H3AoKVn5d0exkGauQ
	 C87s5UUJMSzoxUOV6BNhOojvPd5DpE90BXiva6PON5seXEDMP+JQtPDspJ3Dl8/83Fw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792768719;
	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=t8taL8edTQg/YBtvxE6kIr3WTjB4jdlSUIYz98fZHsc=;
	b=Cw3x/eFSZz9l+mJr8e4OVfCLVpOnxVS+dj7il6UuOGuKcHIbfC9ufON55dnyW9/L2wj9
	 CCGy8i7Fm0DxAeBKM5o4GwqUVVN7sw5gyfeNUp7wLnQJkstduQw8C0Td/922DYmm0QTrm
	 OLsarPxzdwR7DQ5bsIDD41YCDDIXUpPdnE770xBcWDXET5FSKYnA3HO1h1LGnKXiYJE7H
	 vWysh71zTnkv5DqlCuRsSOolOpUK79TWo9WKYXkBx6bSDbswy0TaiwzZA8iSnAuiykwfI
	 cm9X7oWOqF4wYF5BjbToPtcM1MBiHAp563d0bi9gFpFatlyigvGIsSM2pmxPWcoVqKA==
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="bk2u/FkC";
	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 A52D2606A31A
	for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 15:18:39 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 018451F01828;
	Fri, 23 Oct 2026 15:18:38 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792768719;
	bh=t8taL8edTQg/YBtvxE6kIr3WTjB4jdlSUIYz98fZHsc=;
	h=Date:From:To:Cc:In-Reply-To:References:Subject;
	b=bk2u/FkCcJcaGjZJrf7Dpl07p3+GDSPp1i1L6HHMY4ObXuadOXJ8tXSljSCmu/ADg
	 CWMvxcYo5/zwRQrwvVgaErty4MvILj5lpvVVRQR0qEOmNfVRXKFPrwLvbNSlYIvbw3
	 LsMueE8qC8otzYoZrISn082MYa63OM++XCyFxIl29r1iQWIu18DG8yYDg5cJBN2gkI
	 1TR2diWOwakp9v1fKna+jODvP5hjcU99MN6dTyHMV+wAiVn3wQYH2moBHpooXIWO2U
	 D7pEovzqDljVftoDhiCkeqstp43nOWFVkZsviecMQLTk0Yfdm17ABitE+HbRbyVwqn
	 qXolYWpVfPS1Q==
X-Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50])
	by mailfauth.phl.internal (Postfix) with ESMTP id 607B5F40066;
	Fri, 23 Oct 2026 11:18:38 -0400 (EDT)
X-Received: from phl-imap-15 ([10.202.2.104])
  by phl-compute-10.internal (MEProxy); Fri, 23 Oct 2026 11:18:38 -0400
X-ME-Sender: <xms:znrbakHBQ8mifCGJmew34QKAAj2piEJoyqWXEIwSqF8exRnUeWHFzg>
    <xme:znrbaoKC9PL6iHfjMESxy1hYKFFcgphHxRPRI5MbpPjcULJKqpWWFtyT2CO9ki56c
    ptaz6RAazQwrsXiwckBcBqt-8sZmTV16PeYOW6HEir_AhvBIgrdQaw>
X-ME-Proxy-Cause: dmFkZTF+BpdEMgHuzWE4WwiA8xiGC9WjVwxG+HFHt7DFnIE2Zjih90ttPNDP60Fp2XAuua
    sjicSL5P2gGGwpSP3jovCa5hOQw7cIBeSXbFxHYdD+UnTCvlLa+0oCwVJ90PBkG7DJ+yHM
    o3/VvfqeW1kXOtuk/GcSh+pCHUfWXIbfGnU4AZHVFvc87RQEWSBgIVl5w8V1nH2670NPSs
    kSd2I/jdY3IfBgc122CVlWEu/wQus8sUM+oCnIjAylogqIsxqM4J31Ni5uBqJnOz6knfOU
    tMMNTmcSc/9nf9Kr+7zQ14EEdKQMyxS4EVr9Any7m4CK6mlsJp2qyU2B3YnVssY9pLyejo
    UfIeMrhyt7oSaLpXeyjaUgiU+j4eHu5N8rNFUUzJI47HSREBUeZMy5AaVf2dEhEXBafM4Y
    BGxB42rB8spu8t5leUPP9lE9YtKY/UqZX6N4RgW/nAAgYJmcFAAE+31/jZYP6amVrmIfnD
    nHKPvLKczD7xy9YRrR1KUhK6vTSsbkLePcpRBC1kLhbRy5wtq1dAg9fD4uW0E6iGPvXxrM
    fw14xATHzKrOfeHApJIDiDBY0N327MSijebBus7x6EE9IF4sOeL/fH8NW5pdgr3cDovbmG
    r1pBsuldqWivkndbGc9T0MHhcEaAvbauig+g/jl8+XHJKB4MjfWdZXGsBauA
X-ME-Proxy: <xmx:znrbap4dvUJuj58Eb_q42t567UvH8jhCDDmauoozy-VX3uY9zkEnKQ>
    <xmx:znrbajncc7KIrNRm6oqbjOhdffvKlUxt1E13E9aUoa2bD9CWz2cRXQ>
    <xmx:znrbakXdqf-CdtaEi8e6jNgKNxZKRyqDIdrpgZGYkpIUPmRsqIPwTg>
    <xmx:znrbasQngee1SVFQvp7Q9fucbaYZP8J4kY0PkH7MmV_1pbm1ahcd2Q>
    <xmx:znrbahBU3wPVT5MCOsTo9gt1H1IOzOXGaZLDOksEsCUqw5BNBtH_2rtE>
X-Feedback-ID: ifa6e4810:Fastmail
X-Received: by mailuser.phl.internal (Postfix, from userid 501)
	id 3F5DC782738; Fri, 23 Oct 2026 11:18:38 -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: A1Ll-oUXMl1J
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: <179269905670.1189532.10172561334611048258@kernel.org>