All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cen Zhang (Microsoft)" <blbllhy@gmail.com>
To: include@grrlz.net
Cc: AutonomousCodeSecurity@microsoft.com, avagin@gmail.com,
	blbllhy@gmail.com, brauner@kernel.org, jack@suse.cz,
	kys@microsoft.com, linux-kernel@vger.kernel.org,
	mjguzik@gmail.com, oleg@redhat.com, ptikhomirov@virtuozzo.com,
	tgopinath@linux.microsoft.com
Subject: Re: [PATCH] pid: fix cad_pid use-after-free race in proc_do_cad_pid()
Date: Fri, 17 Jul 2026 21:33:25 -0400	[thread overview]
Message-ID: <20260718013325.5651-1-blbllhy@gmail.com> (raw)
In-Reply-To: <D5781615-F6BD-4510-AAEB-8972B5C5828E@grrlz.net>

Thanks both for the review.

One impact clarification: this is not init-namespace-root-only. The sysctl
is mode 0600, but access is checked against the owning user namespace, so
an unprivileged user can reach it via userns + pidns + a proc mount.

The demonstrated impact is a KASAN UAF. On non-debug builds the
proc_do_cad_pid() read path likely only returns a stale pid value unless
the freed pid object is reused in a very tight window.

I'll send a v2 series as suggested: patch 1 deinlines kill_cad_pid()
without functional changes, and patch 2 contains the updated fix.


      reply	other threads:[~2026-07-18  1:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 21:01 [PATCH] pid: fix cad_pid use-after-free race in proc_do_cad_pid() Cen Zhang (Microsoft)
2026-07-17 21:35 ` Mateusz Guzik
2026-07-17 23:14   ` Bradley Morgan
2026-07-18  1:33     ` Cen Zhang (Microsoft) [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=20260718013325.5651-1-blbllhy@gmail.com \
    --to=blbllhy@gmail.com \
    --cc=AutonomousCodeSecurity@microsoft.com \
    --cc=avagin@gmail.com \
    --cc=brauner@kernel.org \
    --cc=include@grrlz.net \
    --cc=jack@suse.cz \
    --cc=kys@microsoft.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.