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: <20110929180021.GA27999@tiehlicka.suse.cz>
Date:	Thu, 29 Sep 2011 20:00:21 +0200
From:	Michal Hocko <mhocko@...e.cz>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	David Rientjes <rientjes@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Konstantin Khlebnikov <khlebnikov@...nvz.org>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Tejun Heo <htejun@...il.com>, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org
Subject: Re: [patch] oom: thaw threads if oom killed thread is frozen before
 deferring

On Thu 29-09-11 18:37:24, Oleg Nesterov wrote:
> On 09/29, Michal Hocko wrote:
> >
> > On Thu 29-09-11 14:05:17, Oleg Nesterov wrote:
> >
> > > But of course this can't help if freeze_task() is called later.
> > > May be freezable() should check TIF_MEMDIE...
> >
> > Wouldn't it be easier to ignore try_to_freeze when fatal signals are
> > pending in get_signal_to_deliver?
> 
> Oh, I don't think so. For what? This doesn't close other races, and
> in fact the fatal_signal_pending() this patch adds is itself racy,
> SIGKILL can come in between.

OK, I think I see your point. You mean that oom will send KILL after
both fatal_signal_pending in refrigerator and signal_pending check in
schedule, right?

> 
> > --- a/kernel/freezer.c
> > +++ b/kernel/freezer.c
> > @@ -48,6 +48,11 @@ void refrigerator(void)
> >  	current->flags |= PF_FREEZING;
> >
> >  	for (;;) {
> > +		if (fatal_signal_pending(current)) {
> > +			if (freezing(current) || frozen(current))
> > +				thaw_process(current);
> 
> Ah, I didn't mean refrigerator() should check freezing/frozen.
> 
> I meant, oom_kill can do this before thaw thaw_process(), afaics
> this should fix the particular race you described (but not others).

This is what the follow up fix from David is doing. Check frozen in
select_bad_process if the task is TIF_MEMDIE and thaw the process.

And it seems that the David's follow up fix is sufficient so let's leave
refrigerator alone.
Or am I still missing something?

> 
> And. It is simply wrong to return from refrigerator() after we set
> PF_FROZEN, this can fool try_to_freeze_tasks(). Sure, thaw_process()
> from oom_kill is not nice too, but at least this is the special case,
> we already have the problem.
> 
> Oleg.
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic
--
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