Skip to contentSkip to conversation

tls: don't abort the connection on signal-interrupted sends

PATCH Applied Maximilian Immanuel Brandtner 2 participants 2 messages Aug 5 – Aug 6

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tls: don't abort the connection on signal-interrupted sends

When a signal interrupts a blocking send, tls_tx_records() treats the resulting -ERESTARTSYS as a transmission failure and marks the socket errored via tls_err_abort() with the raw error code. Later syscalls return the kernel-internal errno 512 (ERESTARTSYS) to userspace, as the signal it stems from is no longer pending during syscall exit and thus never translated.

An interrupted send is not a connection error: the partially sent record stays queued and is resent later. Interrupt error codes are therefore excluded from the abort in the same way as -EAGAIN.

Fixes b341ca51d267 ("tls: Fix tls_sw_sendmsg error handling")

---
Changes in v2:
- remove checks for unused restart error codes
- check error codes inline

Tested on top of net commit 3f1f75536668 ("net: openvswitch: reject oversized nested action attrs").

---
 net/tls/tls_sw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/tls/tls_sw.c +1 -1
index d4afc90fd796..4d1fa9b04181 100644
@@ -458,7 +458,7 @@ int tls_tx_records(struct sock *sk, int flags)
 	}
 
 tx_err:
-	if (rc < 0 && rc != -EAGAIN)
+	if (rc < 0 && rc != -EAGAIN && rc != -EINTR && rc != -ERESTARTSYS)
 		tls_err_abort(sk, rc);
 
 	return rc;
Signature · 1 line
2.55.0
#1 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 5 Aug 2026 08:22:48 +0200 you wrote:

When a signal interrupts a blocking send, tls_tx_records() treats the resulting -ERESTARTSYS as a transmission failure and marks the socket errored via tls_err_abort() with the raw error code. Later syscalls return the kernel-internal errno 512 (ERESTARTSYS) to userspace, as the signal it stems from is no longer pending during syscall exit and thus never translated.

[...]

Here is the summary with links:
- [net,v2] tls: don't abort the connection on signal-interrupted sends

    https://git.kernel.org/netdev/net/c/af0e5cdd031f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html