lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YS60T2bfLpxb6SUY@slm.duckdns.org>
Date:   Tue, 31 Aug 2021 12:59:27 -1000
From:   Tejun Heo <tj@...nel.org>
To:     Zhang Qiao <zhangqiao22@...wei.com>
Cc:     peterz@...radead.org, juri.lelli@...hat.com,
        linux-kernel@...r.kernel.org, mingo@...hat.com,
        vincent.guittot@...aro.org
Subject: Re: [PATCH] kernel/sched: Fix sched_fork() access an invalid
 sched_task_group

Hello,

On Tue, Aug 31, 2021 at 03:58:42PM +0800, Zhang Qiao wrote:
> > I think this would allow cgroup migrations to take place before
> > sched_post_fork() is run, which likely will break stuff. The right
> > thing to do likely is taking sched_task_group (and whatever other
> > fields) after cgroup_can_fork(), which fixates the cgroup memberships,
>
> But it still seems possible that it accessed an invalid sched_task_group?
> because the child process does not update its sched_task_group util
> cgroup_post_fork().

Between cgroup_can_fork() and cgroup_post_fork(), the cgroup membership and
thus sched_task_group can't change, so if the child sets it to the parent's
inbetween, the sched_task_group can't go away.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ