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:	Sat, 29 Oct 2011 08:42:09 -0400
From:	Neil Horman <nhorman@...driver.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Mandeep Singh Baines <msb@...omium.org>,
	linux-kernel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Earl Chew <earl_chew@...lent.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Andi Kleen <andi@...stfloor.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] exec: log when wait_for_dump_helpers aborts due to a
 signal

On Fri, Oct 28, 2011 at 04:26:31PM -0700, Andrew Morton wrote:
> On Tue, 25 Oct 2011 18:07:08 -0700
> Mandeep Singh Baines <msb@...omium.org> wrote:
> 
> > To allow coredump pipe readers to look at /proc/<pid> of the crashing
> > process, the kernel waits for the reader to exit. However, the wait
> > is silently aborted if the crashing process is signalled.
> > 
> > This patch, logs whenever wait_for_dump_helpers is aborted or in order
> > to assist in debugging cases where /proc/<pid> is gone.
> 
> You don't really describe what problem you're observing.  What's the
> use case?  What are you trying to do?  etc.
> 
> Because if that is known, we can perhaps find better solutions.
> 
> > Alternatively, we may want to consider not aborting on a signal. You
> > could always break the loop by killing the reader process.
> 
> Well.  Neil's changelog for 61be228a06dc6e8662 is quite nice and tells
> us everything we could possibly want to know, except for why it tests
> sgnal_pending() :(
> 
> Neil, Oleg: can you remember?
> 
I _think_ it was a way to detect if the helper was still running, or had become
stuck.  I.e. we send the process a SIGIO, and if on the next iteration its still
pending, we can assume something has gone wrong, and abort the dump.  Of course
my memory could be faulty, Oleg do you have better recollection than I?

I'm heading out for a long weekend, but when I get back, I'll dig through the
archives for a better answer.  I recall Oleg and I talking at length about this
code.

> > --- a/fs/exec.c
> > +++ b/fs/exec.c
> > @@ -2030,7 +2030,14 @@ static void wait_for_dump_helpers(struct file *file)
> >  	pipe->readers++;
> >  	pipe->writers--;
> >  
> > -	while ((pipe->readers > 1) && (!signal_pending(current))) {
> > +	while (pipe->readers > 1) {
> > +		if (signal_pending(current)) {
> > +			pr_info("wait_for_dump_helpers[%d]: "
> > +				"aborted due to signal\n",
> > +				task_pid_nr(current));
> > +			break;
> > +		}
> > +
> 
> argh, printk("i screwed up").  Hopefully we can find a better solution
> to whatever-your-problem is than this!
> 
--
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