Re: [PATCH v3 05/10] net: turn sk_peer_pid into an array indexed by pid type

From: Kuniyuki Iwashima

Date: Thu Oct 01 2026 - 00:23:39 EST


On Mon, Sep 28, 2026 at 2:27 AM Andrew Halaney <andrew@xxxxxxxxxxxx> wrote:
>
> From: Christian Brauner <brauner@xxxxxxxxxx>
>
> Currently only the struct pid of the thread-group leader is recorded
> for a socket's peer. To make room for the struct pid of the thread that
> called connect(), listen() or socketpair() turn sk_peer_pid into an
> array indexed by pid type. All users, including bluetooth and the
> coredump socket, keep using the PIDTYPE_TGID slot.
>
> Nothing fills the PIDTYPE_PID slot yet. No functional changes.
>
> Signed-off-by: Christian Brauner (Amutable) <brauner@xxxxxxxxxx>
> Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@xxxxxxxxxxxxxx>
> Signed-off-by: Andrew Halaney <andrew@xxxxxxxxxxxx>

Technically, sk_peer_pid/lock do not need to be in struct sock and
can avoid bloating it just for a single user, but I can follow up on it.

Reviewed-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>