Re: [PATCH net v2 1/2] netlink: check sk_rcvbuf before charging the dump skb

From: Eric Dumazet

Date: Tue Oct 27 2026 - 12:31:35 EST


Le mar. 27 oct. 2026 à 15:04, Jhonata Poma-Hansen via B4 Relay
<devnull+jhonata.poma.gmail.com@xxxxxxxxxx> a écrit :
>
> From: Jhonata Poma-Hansen <jhonata.poma@xxxxxxxxx>
>
> Since commit ae8f160e7eb2 ("netlink: Fix wraparounds of
> sk->sk_rmem_alloc."), netlink_dump() charges the dump skb first and
> queues it only if sk_rmem_alloc is still below sk_rcvbuf. Commit
> a215b5723922 ("netlink: make sure we allow at least one dump skb")
> added an exception for an empty socket.
>
> A dump that starts while something else is still charged to a socket
> with a small receive buffer fails with ENOBUFS and stays running.
> Every recvmsg() retries it, fails again and sets sk_err, so a reader
> that peeks before reading, as libnl does, gets ENOBUFS on the read
> after each peek, never consumes the message at the head of the queue
> and spins forever.

Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>