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: <20150506101927.GA17291@gmail.com>
Date:	Wed, 6 May 2015 12:19:27 +0200
From:	Ingo Molnar <mingo2.kernel.org@...il.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Neil Brown <neilb@...e.de>, Evgeniy Polyakov <zbr@...emap.net>,
	Stephen Smalley <sds@...ho.nsa.gov>,
	Alex Williamson <alex.williamson@...hat.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	kvm <kvm@...r.kernel.org>
Subject: Re: [PATCH] signals: Generate warning when flush_signals() is called
 from non-kthread context


* Oleg Nesterov <oleg@...hat.com> wrote:

> > --- a/kernel/signal.c
> > +++ b/kernel/signal.c
> > @@ -427,6 +427,10 @@ void flush_signals(struct task_struct *t)
> >  {
> >  	unsigned long flags;
> >
> > +	/* Only kthreads are allowed to destroy signals: */
> > +	if (WARN_ON_ONCE(!(current->flags & PF_KTHREAD)))
> > +		return;
> > +
> 
> But I am not sure this can't make some buggy driver even more buggy.
> Just suppose it does something
> 
> 	do {
> 		if (signal_pending())
> 			flush_signals();
> 	} while (wait_event_interruptible(...));
> 
> and this change will turn this into busy-wait loop.
> 
> So perhaps another change which just adds WARN_ON_RATELIMIT() 
> without "return" will be safer?

Yeah, absolutely.

Thanks,

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