Re: [PATCH net 0/4] af_unix: Fix inq_len and scm_stat.nr_fds accounting leaks
From: Kuniyuki Iwashima
Date: Tue Nov 10 2026 - 01:42:24 EST
On Fri, 06 Nov 2026 05:19:01 +0000, Siddharth Chintamaneni wrote:
> This series fixes receive-queue accounting leaks of u->inq_len and
> u->scm_stat.nr_fds in AF_UNIX sockets, along with selftests:
>
> - Patch 1 fixes a u->inq_len leak in manage_oob() when an unconsumed
> out-of-band (MSG_OOB) skb is skipped and dropped during a normal read.
> - Patch 2 fixes u->scm_stat.nr_fds leaks when an OOB skb is skipped or
> freed in manage_oob(), unix_stream_recv_urg(), and
> unix_stream_read_skb().
> - Patch 3 fixes a u->scm_stat.nr_fds leak in unix_dgram_disconnected()
> when purging queued skbs from sk->sk_receive_queue on disconnect.
> - Patch 4 adds SIOCINQ and scm_fds (/proc/self/fdinfo/<fd>) checks to
> the msg_oob and scm_rights selftests.
I planed to drop MSG_OOB support in this cycle.
Could you repost without OOB changes ?
>
> Siddharth Chintamaneni (4):
> af_unix: Fix inq_len leak when skipping unread OOB skb.
> af_unix: Fix scm_stat.nr_fds leaks for OOB skb.
> af_unix: Fix scm_stat.nr_fds leak in unix_dgram_disconnected().
> selftest: af_unix: Test SIOCINQ and scm_fds with OOB and dgram
> disconnect.
>
> net/unix/af_unix.c | 69 ++++++-----
> tools/testing/selftests/net/af_unix/msg_oob.c | 12 +-
> .../selftests/net/af_unix/scm_rights.c | 108 ++++++++++++++++++
> 3 files changed, 161 insertions(+), 28 deletions(-)
>
> --
> 2.43.0
>