Re: [PATCH] tcp: tcp_make_synack() can be called from process context

From: Eric Dumazet
Date: Thu Mar 09 2023 - 08:38:12 EST


On Wed, Mar 8, 2023 at 8:07 PM Breno Leitao <leitao@xxxxxxxxxx> wrote:
>
> tcp_rtx_synack() now could be called in process context as explained in
> 0a375c822497 ("tcp: tcp_rtx_synack() can be called from process
> context").
>
> tcp_rtx_synack() might call tcp_make_synack(), which will touch per-CPU
> variables with preemption enabled. This causes the following BUG:
>
>
> Avoid calling __TCP_INC_STATS() with will touch per-cpu variables. Use
> TCP_INC_STATS() which is safe to be called from context switch.
>
> Fixes: 8336886f786f ("tcp: TCP Fast Open Server - support TFO listeners")
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
>

This looks good to me, thanks !

Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>