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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpV71KMJEm_-VY0EPJngM-yNHOVv5niXgy9+7jnWw3=wBQ@mail.gmail.com>
Date:	Mon, 11 Aug 2014 17:20:50 -0700
From:	Cong Wang <xiyou.wangcong@...il.com>
To:	David Rientjes <rientjes@...gle.com>
Cc:	LKML <linux-kernel@...r.kernel.org>, Michal Hocko <mhocko@...e.cz>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>, Tejun Heo <tj@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [Patch] freezer: check OOM kill signal while being frozen

On Sat, Aug 9, 2014 at 1:55 AM, David Rientjes <rientjes@...gle.com> wrote:
> On Fri, 8 Aug 2014, Cong Wang wrote:
>
>> diff --git a/kernel/freezer.c b/kernel/freezer.c
>> index aa6a8aa..c6d189d 100644
>> --- a/kernel/freezer.c
>> +++ b/kernel/freezer.c
>> @@ -68,7 +68,9 @@ bool __refrigerator(bool check_kthr_stop)
>>               spin_lock_irq(&freezer_lock);
>>               current->flags |= PF_FROZEN;
>>               if (!freezing(current) ||
>> -                 (check_kthr_stop && kthread_should_stop()))
>> +                 (check_kthr_stop && kthread_should_stop()) ||
>> +                 (test_tsk_thread_flag(current, TIF_MEMDIE) &&
>> +                      fatal_signal_pending(current)))
>>                       current->flags &= ~PF_FROZEN;
>>               spin_unlock_irq(&freezer_lock);
>>
>
> All threads with TIF_MEMDIE set would have been killed, why is the check
> for fatal_signal_pending(current) needed?

So just checking TIF_MEMDIE is enough, right?

>
> You can also use test_thread_flag(TIF_MEMDIE) instead since you're only
> concerned with current.
>

OK, will do.

> Furthermore, that conditional is getting difficult to read.  Maybe it
> would help to have a helper function that returns bool that determines
> whether PF_FROZEN should be cleared?

Makes sense.

Thanks.
--
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