I don't think you need to bother secu…@kernel.org since you sent
this publicly. Dropped the cc.
2026-11-27, 14:01:16 +0000, Dickson Wu via B4 Relay wrote:
> From: Dickson Wu <dick…@certik.com>
>
> When a ready record disappears from the TCP receive queue while the
> socket lock is released, tls_strp_msg_load() returns false and
> tls_rx_rec_wait() retries by calling itself.
>
> The self-call was expected to become a loop, but the wait entry is
> address-taken and live across the call, so the compiler keeps a real
I'm not clear on what "address-taken" means and why it makes a
difference to the compiler in deciding tail call vs real call.
(not sure yet if it's worth adding to the commit message)
> call. GCC 13.3 and Clang 18.1 both do this on x86_64 defconfig and on a
In https://lore.kernel.org/netdev/2025…@kernel.org/
Jakub said "both clang and gcc get it right", I wonder what
changed. Or is it just old versions being a bit dumb?
> distro config, with and without KASAN, costing 128 to 288 bytes of
> stack per retry. A local user can keep draining the queue with
> TCP_ZEROCOPY_RECEIVE while a reader waits and overflow the kernel
Or we should disallow this for all ULPs? I think they're all going to
get confused by their data being stolen.
[...]
> diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
> index 226e0f176fdc..363aae36ac69 100644
> --- a/net/tls/tls_sw.c
> +++ b/net/tls/tls_sw.c
> @@ -1104,9 +1104,11 @@ tls_rx_rec_wait(struct sock *sk, bool nonblock, bool released, bool has_copied)
> struct tls_context *tls_ctx = tls_get_ctx(sk);
> struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
> DEFINE_WAIT_FUNC(wait, woken_wake_function);
> - int ret = 0;
> + int ret;
> long timeo;
nit: reverse xmas tree
https://docs.kernel.org/process/maintainer-netdev.html
>
> +retry:
> + ret = 0;
> /* a rekey is pending, let userspace deal with it */
> if (unlikely(ctx->key_update_pending))
> return -EKEYEXPIRED;
--
Sabrina