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]
Date:	Wed, 10 Sep 2014 13:30:25 -0700
From:	Cong Wang <xiyou.wangcong@...il.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	Tejun Heo <tj@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
	David Rientjes <rientjes@...gle.com>,
	Michal Hocko <mhocko@...e.cz>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [Patch v4 1/2] freezer: check OOM kill while being frozen

On Mon, Sep 8, 2014 at 4:29 PM, Cong Wang <xiyou.wangcong@...il.com> wrote:
> On Mon, Sep 8, 2014 at 4:42 PM, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
>> On Monday, September 08, 2014 04:16:15 PM Cong Wang wrote:
>>> On Mon, Sep 8, 2014 at 4:23 PM, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
>>> >
>>> > The reason why it matters for the suspend-time freezing is that we freeze tasks
>>> > to take them out of the picture entirely until they are thawed.  Therefore we
>>> > can't allow them to go back to the picture just for a while until they are
>>> > killed.  Frozen tasks are not supposed to get back to the picture at all.
>>> >
>>>
>>>
>>> Ok, then checking TIF_MEMDIE is unsafe for PM freeze, we should
>>> keep the cgroup_freezing() test to make sure freeze request is from
>>> cgroup not PM. Question got answered. :)
>>
>> Do I think correctly that cgroups freezing and system suspend are
>> mutually exclusive?  If not, then this still is problematic.
>
> Good point! Although rare, but it is possible we freeze a process both from
> cgroup and PM. Hmm, this means we have to explicitly exclude PM rather
> just checking cgroup freeze? Interesting, but I am not familiar with PM.
>

I am wondering if the folllowing check makes any sense with regarding
to rule out PM freeze:

        if ((!pm_nosig_freezing && !pm_freezing) &&
            cgroup_freezing(current) && test_thread_flag(TIF_MEMDIE))
                return true;

PM will not freeze the process again if it is already frozen by cgroup,
so here we just make sure that it will not thaw if PM freeze is in progress.

Am I missing anything?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ