Re: [syzbot] [net?] INFO: task hung in tls_sw_sendpage (3)

From: Jakub Kicinski
Date: Mon Feb 27 2023 - 18:53:59 EST


On Mon, 27 Feb 2023 21:35:41 +0100 Eric Dumazet wrote:
> This looks suspicious to me
>
> commit 79ffe6087e9145d2377385cac48d0d6a6b4225a5
> Author: Jakub Kicinski <kuba@xxxxxxxxxx>
> Date: Tue Nov 5 14:24:35 2019 -0800
>
> net/tls: add a TX lock
>
>
> If tls_sw_sendpage() has to call sk_stream_wait_memory(),
> sk_stream_wait_memory() is properly releasing the socket lock,
> but knows nothing about mutex_{un}lock(&tls_ctx->tx_lock);

That's supposed to be the point of the lock, prevent new writers from
messing with the partially pushed records when the original writer
is waiting for write space.

Obvious hack but the async crypto support makes TLS a bit of a mess :|

sendpage_lock not taking tx_lock may lead to obvious problems, I'm not
seeing where the deadlock is, tho..