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: <20140930134324.GE4241@worktop.programming.kicks-ass.net>
Date:	Tue, 30 Sep 2014 15:43:24 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	mingo@...nel.org, torvalds@...ux-foundation.org,
	tglx@...utronix.de, ilya.dryomov@...tank.com,
	umgwanakikbuti@...il.com, linux-kernel@...r.kernel.org,
	Rusty Russell <rusty@...tcorp.com.au>,
	Fengguang Wu <fengguang.wu@...el.com>
Subject: Re: [PATCH 08/11] module: Fix nested sleep

On Tue, Sep 30, 2014 at 12:18:23AM +0200, Oleg Nesterov wrote:
> On 09/24, Peter Zijlstra wrote:
> >
> > A genuine bug, we cannot use blocking primitives inside a wait loop.
> >
> > So rewrite the wait_event_interruptible() usage to use the fresh
> > wait_woken() stuff.
> 
> OK, but ...
> 
> > +static int wait_finished_loading(struct module *mod)
> > +{
> > +	DEFINE_WAIT_FUNC(wait, woken_wake_function);
> > +	int ret = 0;
> > +
> > +	add_wait_queue(&module_wq, &wait);
> > +	for (;;) {
> > +		if (finished_loading(mod->name))
> > +			break;
> > +
> > +		if (signal_pending_state(TASK_INTERRUPTIBLE, current)) {
> 
> I am puzzled by this line, why not
> 
> 		if (signal_pending(current)) {
> 
> ?
> 
> this should be 100% equivalent.

Ah, because I looked at ___wait_event() and that ends up using
signal_pending_state() through preprare_to_wait_event().

I did not actually 'think' much. Lemme change that for you.
--
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