From: Oleg Nesterov <oleg@redhat.com>
To: alexjlzheng@gmail.com
Cc: usamaarif642@gmail.com, david@kernel.org,
akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
mingo@kernel.org, alexjlzheng@tencent.com, ruippan@tencent.com,
mjguzik@gmail.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2] procfs: fix missing RCU protection when reading real_parent in do_task_stat()
Date: Wed, 28 Jan 2026 09:48:43 +0100 [thread overview]
Message-ID: <aXnNa2jymiJYjzij@redhat.com> (raw)
In-Reply-To: <20260128083007.3173016-1-alexjlzheng@tencent.com>
On 01/28, alexjlzheng@gmail.com wrote:
>
> From: Jinliang Zheng <alexjlzheng@tencent.com>
>
> When reading /proc/[pid]/stat, do_task_stat() accesses task->real_parent
> without proper RCU protection, which leads:
>
> cpu 0 cpu 1
> ----- -----
> do_task_stat
> var = task->real_parent
> release_task
> call_rcu(delayed_put_task_struct)
> task_tgid_nr_ns(var)
> rcu_read_lock <--- Too late to protect task->real_parent!
> task_pid_ptr <--- UAF!
> rcu_read_unlock
>
> This patch use task_ppid_nr_ns() instead of task_tgid_nr_ns() to adds
> proper RCU protection for accessing task->real_parent.
>
> Fixes: 06fffb1267c9 ("do_task_stat: don't take rcu_read_lock()")
> Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
prev parent reply other threads:[~2026-01-28 8:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 8:30 [PATCH v2] procfs: fix missing RCU protection when reading real_parent in do_task_stat() alexjlzheng
2026-01-28 8:48 ` 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=aXnNa2jymiJYjzij@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alexjlzheng@gmail.com \
--cc=alexjlzheng@tencent.com \
--cc=david@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mingo@kernel.org \
--cc=mjguzik@gmail.com \
--cc=ruippan@tencent.com \
--cc=usamaarif642@gmail.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