The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Bradley Morgan <include@grrlz.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Alexey Gladkov <legion@kernel.org>,
	"Cen Zhang (Microsoft)" <blbllhy@gmail.com>,
	Christian Brauner <brauner@kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Mateusz Guzik <mjguzik@gmail.com>,
	Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sysctl: move the "cad_pid" entry from pid_table[] to kern_reboot_table[]
Date: Mon, 20 Jul 2026 13:57:39 +0200	[thread overview]
Message-ID: <al4NM4ZcVaksrwvz@redhat.com> (raw)
In-Reply-To: <E59667D0-6642-458C-ADED-401DC48E4C47@grrlz.net>

On 07/20, Bradley Morgan wrote:
>
> On July 20, 2026 12:13:43 PM GMT+01:00, Oleg Nesterov <oleg@redhat.com>
> wrote:
> >cad_pid is global, and kill_cad_pid() is only used in the root namespace.
> >
> >However, due to pid_table_root_permissions(), a non-root user can unshare
> >pid/user namespaces and modify it from the child namespace. This makes no
> >sense and is simply wrong.
> >
> >Move it to kern_reboot_table[] where it logically belongs; this ensures
> >that only GLOBAL_ROOT_UID can read/modify this sysctl.
> >
> >Note that this patch doesn't preserve "#ifdef CONFIG_PROC_SYSCTL" around
> >the "cad_pid"; CONFIG_PROC_SYSCTL selects CONFIG_SYSCTL, so it is always
> >set when kern_reboot_table[] is compiled.
>
> Worlds smallest nit: Could you add the patch this was inspired by in the
> description?
>
> E.g:
> <proposal>
> This patch was inspired from Cens patch fixing a UAF in cid_pid [1]

This patch was inspired by sashiko.dev who found this problem. Not by
the patches from Cen.

I'd be happy to add Reported-by: sashiko.dev but I don't think I can.

Oleg.


      parent reply	other threads:[~2026-07-20 11:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 11:13 [PATCH v2] sysctl: move the "cad_pid" entry from pid_table[] to kern_reboot_table[] Oleg Nesterov
2026-07-20 11:35 ` Oleg Nesterov
2026-07-20 11:46 ` Bradley Morgan
2026-07-20 11:49   ` Bradley Morgan
2026-07-20 11:57   ` Oleg Nesterov [this message]

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=al4NM4ZcVaksrwvz@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=blbllhy@gmail.com \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=include@grrlz.net \
    --cc=legion@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=ptikhomirov@virtuozzo.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