[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220609100031.GA11537@blackbody.suse.cz>
Date: Thu, 9 Jun 2022 12:00:31 +0200
From: Michal Koutný <mkoutny@...e.com>
To: 史思远 <shisiyuan19870131@...il.com>
Cc: Tejun Heo <tj@...nel.org>, Johannes Weiner <hannes@...xchg.org>,
Li Zefan <lizefan@...wei.com>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, shisiyuan <shisiyuan@...omi.com>
Subject: Re: [PATCH] cgroup: handle cset multiidentity issue when migration
Hello.
On Thu, Jun 09, 2022 at 11:49:38AM +0800, 史思远 <shisiyuan19870131@...il.com> wrote:
> The process is like above photo, thread 2 exits
> between cgroup_migrate_prepare_dst() and cgroup_migrate_execute().
> Then the refcount of csetX turns to be 0 here, and UAF appears when thread1
> migrating.
> Thread2 exits asynchronously, can rwsem prevent it?
See the bailout in cgroup_migrate_add_task():
if (task->flags & PF_EXITING)
return;
And cgroup_threadgroup_change_begin(tsk) in exit_signals().
> The purpose of my patch is to keep csetX's refcount still 1 after thread2
> exits, and make sure thread1 migrating successfully.
Why is not src_cset==dst_cset in cgroup_migrate_prepare_dst() not
sufficient?
Still, can this be reproduced in real world or is your reasoning based
on theory only?
Thanks,
Michal
Powered by blists - more mailing lists