The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: "Cen Zhang (Microsoft)" <blbllhy@gmail.com>
Cc: brauner@kernel.org,  oleg@redhat.com,  akpm@linux-foundation.org,
	jack@suse.cz,  avagin@gmail.com,  ptikhomirov@virtuozzo.com,
	mjguzik@gmail.com,  include@grrlz.net,  legion@kernel.org,
	linux-kernel@vger.kernel.org,
	 AutonomousCodeSecurity@microsoft.com,
	tgopinath@linux.microsoft.com,  kys@microsoft.com
Subject: Re: [PATCH v3 1/2] pid: deinline kill_cad_pid
Date: Mon, 20 Jul 2026 08:19:56 -0500	[thread overview]
Message-ID: <87tsptu7b7.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <20260719155842.7069-1-blbllhy@gmail.com> (Cen Zhang's message of "Sun, 19 Jul 2026 11:58:41 -0400")

"Cen Zhang (Microsoft)" <blbllhy@gmail.com> writes:

> Move kill_cad_pid() out of the header without changing behavior. This
> prepares for taking a reference to cad_pid under RCU in the following
> fix.

nit: If you are going to uninline kill_cad_pid should be placed in
signal.c not in pid.c

That is where everything else that sends signals lives.

Eric

> Suggested-by: Mateusz Guzik <mjguzik@gmail.com>
> Suggested-by: Bradley Morgan <include@grrlz.net>
> Reviewed-by: Bradley Morgan <include@grrlz.net>
> Link: https://lore.kernel.org/all/CAGudoHH0vz=1m97EDHQFLLwGJmDPmqWJ+444b7rMiD059drEwQ@mail.gmail.com/
> Signed-off-by: Cen Zhang (Microsoft) <blbllhy@gmail.com>
> ---
> v3: Add Reviewed-by from Bradley Morgan.
> v2: New preparatory patch to deinline kill_cad_pid().
>
>  include/linux/sched/signal.h | 5 +----
>  kernel/pid.c                 | 5 +++++
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h
> index 584ae88b435e..d45a5476b97d 100644
> --- a/include/linux/sched/signal.h
> +++ b/include/linux/sched/signal.h
> @@ -562,10 +562,7 @@ static inline sigset_t *sigmask_to_save(void)
>  	return res;
>  }
>  
> -static inline int kill_cad_pid(int sig, int priv)
> -{
> -	return kill_pid(cad_pid, sig, priv);
> -}
> +int kill_cad_pid(int sig, int priv);
>  
>  /* These can be the second arg to send_sig_info/send_group_sig_info.  */
>  #define SEND_SIG_NOINFO ((struct kernel_siginfo *) 0)
> diff --git a/kernel/pid.c b/kernel/pid.c
> index f55189a3d07d..234ebee29375 100644
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -557,6 +557,11 @@ pid_t pid_vnr(struct pid *pid)
>  }
>  EXPORT_SYMBOL_GPL(pid_vnr);
>  
> +int kill_cad_pid(int sig, int priv)
> +{
> +	return kill_pid(cad_pid, sig, priv);
> +}
> +
>  pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
>  			struct pid_namespace *ns)
>  {

  parent reply	other threads:[~2026-07-20 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-19 15:58 [PATCH v3 1/2] pid: deinline kill_cad_pid Cen Zhang (Microsoft)
2026-07-19 15:58 ` [PATCH v3 2/2] pid: fix cad_pid use-after-free race Cen Zhang (Microsoft)
2026-07-20 10:09   ` Pavel Tikhomirov
2026-07-19 16:20 ` [PATCH v3 1/2] pid: deinline kill_cad_pid Oleg Nesterov
2026-07-19 16:26   ` Cen Zhang (Microsoft)
2026-07-20  9:56 ` Pavel Tikhomirov
2026-07-20 13:19 ` Eric W. Biederman [this message]
2026-07-20 13:45   ` Oleg Nesterov
2026-07-20 14:01     ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tsptu7b7.fsf@email.froward.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=AutonomousCodeSecurity@microsoft.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@gmail.com \
    --cc=blbllhy@gmail.com \
    --cc=brauner@kernel.org \
    --cc=include@grrlz.net \
    --cc=jack@suse.cz \
    --cc=kys@microsoft.com \
    --cc=legion@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=oleg@redhat.com \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=tgopinath@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox