[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250704104042.86223-1-laurabrehm@hey.com>
Date: Fri, 4 Jul 2025 12:40:42 +0200
From: Laura Brehm <laurajfbrehm@...il.com>
To: brauner@...nel.org
Cc: laurabrehm@....com,
laurajfbrehm@...il.com,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] coredump: fix race condition between connect and
> kernel_connect()
> -> sock->ops->connect::unix_stream_connect()
> -> prepare_peercred()
> -> pidfs_register_pid()
Ah, thank you! I initially ran into this while working from an older
tree that had had the coredump-socket series cherry-picked into it,
but it was missing Commit fd0a109a0f6b7524543d17520da92a44a9f5343c
("net, pidfs: prepare for handing out pidfds for reaped
sk->sk_peer_pid").
My tree instead had:
static void init_peercred(struct sock *sk)
{
sk->sk_peer_pid = get_pid(task_tgid(current));
sk->sk_peer_cred = get_current_cred();
}
I switched over to the main tree when preparing patches, but missed
that the issue was not present there.
> Honestly curious: is that something you actually observed or that you
> think may happen or that an some coding assistant thinks might happen?
No coding assistants (not a fan), but I understand the question. I
maintain some other large projects and we get a few inane patches
too. I usually try my best to avoid making patches such as these
without some amount of double checking if I'm addressing a real issue,
but I did run into the issue I described (about half the time,
depending on how fast the coredump server ran) in my tree, and I
forgot to repro after switching trees.
Apologies for the inconvenience, and for the understanding/quick
replies!
Powered by blists - more mailing lists