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:	Mon, 22 Aug 2011 11:53:57 +0200
From:	Tejun Heo <tj@...nel.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	rjw@...k.pl, menage@...gle.com, linux-kernel@...r.kernel.org,
	arnd@...db.de, Jens Axboe <axboe@...nel.dk>,
	Henrique de Moraes Holschuh <ibm-acpi@....eng.br>
Subject: Re: [PATCH 04/16] freezer: implement and use
 kthread_freezable_should_stop()

Hey, Oleg.

On Sun, Aug 21, 2011 at 09:14:21PM +0200, Oleg Nesterov wrote:
> But. can't __refrigerator() race with thaw_process() in this case?
> 
> > +bool __refrigerator(bool check_kthr_stop)
> >  {
> >  	/* Hmm, should we be allowed to suspend when there are realtime
> >  	   processes around? */
> > @@ -50,7 +51,8 @@ bool __refrigerator(void)
> >
> >  	for (;;) {
> >  		set_current_state(TASK_UNINTERRUPTIBLE);
> > -		if (!frozen(current))
> > +		if (!frozen(current) ||
> > +		    (check_kthr_stop && kthread_should_stop()))
> >  			break;
> 
> OK, but then we do
> 
> 	current->flags &= ~PF_FREEZING;
> 
> since PF_FROZEN wasn't cleared this can race with
> 
> 	p->flags &= ~PF_FROZEN;
> 
> No?

Indeed, I removed PF_FREEZING and moved PF_FROZEN to __refrigerator()
in later patches, so it's already gone.  Patches could have been
sequenced better, I suppose.  But, sequencing fixes for different
races was already pretty challenging.  :)

Thanks.

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