From: Eric Dumazet <[email protected]>
Date: Thu, 20 Dec 2018 15:28:56 -0800
> Alexei reported use after frees in inet_diag_dump_icsk() [1]
>
> Because we use refcount_set() when various sockets are setup and
> inserted into ehash, we also need to make sure inet_diag_dump_icsk()
> wont race with the refcount_set() operations.
>
> Jonathan Lemon sent a patch changing net_twsk_hashdance() but
> other spots would need risky changes.
>
> Instead, fix inet_diag_dump_icsk() as this bug came with
> linux-4.10 only.
>
> [1] Quoting Alexei :
...
> Fixes: 67db3e4bfbc9 ("tcp: no longer hold ehash lock while calling
> tcp_get_info()")
> Signed-off-by: Eric Dumazet <[email protected]>
> Reported-by: Alexei Starovoitov <[email protected]>
> Cc: Jonathan Lemon <[email protected]>
Applied and queued up for -stable, thanks Eric.