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>] [day] [month] [year] [list]
Date:	Thu, 27 Oct 2011 10:31:30 -0700 (PDT)
From:	scott@...split.com
To:	fa.linux.kernel@...glegroups.com
Cc:	Mandeep Singh Baines <msb@...omium.org>,
	linux-kernel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Neil Horman <nhorman@...driver.com>,
	Earl Chew <earl_chew@...lent.com>,
	Andi Kleen <andi@...stfloor.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] exec: log when wait_for_dump_helpers aborts due to a signal

I wonder whether we could use a slightly different approach for this loop.

In the current code in the case where there is a signal pending on the crashing process (in our case it looks like it's SIGTERM as a result of the process group being killed) we never call pipe_wait() at all. This means everything is certainly missing from /proc if the crashing process is reaped before crash-reporter gets a look-in.

What would be the side-effect of changing the code such that we call pipe_wait() at least once in this scenario, for example:


diff --git a/fs/exec.c b/fs/exec.c
index 25dcbe5..8959d304 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2030,11 +2030,11 @@ static void wait_for_dump_helpers(struct file *file)
        pipe->readers++;
        pipe->writers--;
 
-       while ((pipe->readers > 1) && (!signal_pending(current))) {
+       do {
                wake_up_interruptible_sync(&pipe->wait);
                kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
                pipe_wait(pipe);
-       }
+       } while ((pipe->readers > 1) && (!signal_pending(current)));
 
        pipe->readers--;
        pipe->writers++;

This way around would it not at least wait for the core_pattern user mode helper to call read() at least once before bailing out due to signal?

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