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

On Sat, Aug 16, 2014 at 5:20 AM, Tejun Heo <tj@...nel.org> wrote:
> On Thu, Aug 14, 2014 at 02:15:25PM -0700, Cong Wang wrote:
>> +static bool should_thaw_current(bool check_kthr_stop)
>> +{
>> +     if (!freezing(current) ||
>> +         (check_kthr_stop && kthread_should_stop()) ||
>> +         test_thread_flag(TIF_MEMDIE))
>> +             return true;
>> +     else
>> +             return false;
>> +}
>
> I'm not sure this is safe w.r.t. hibernation.  Please cc Rafael on
> freezer related changes.

Or we can just check for cgroup freeze, something like below:

diff --git a/kernel/freezer.c b/kernel/freezer.c
index 33cbcb0..b06a059 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -56,7 +56,8 @@ static bool should_thaw_current(bool check_kthr_stop)
 {
        if (!freezing(current) ||
            (check_kthr_stop && kthread_should_stop()) ||
-           test_thread_flag(TIF_MEMDIE))
+           /* It might not be safe to check TIF_MEMDIE for pm freeze */
+           (cgroup_freezing(current) && test_thread_flag(TIF_MEMDIE)))
                return true;
        else
                return false;


Are you happy now, Tejun? :)
--
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