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:	Tue, 25 Oct 2011 18:24:02 -0700
From:	Mandeep Singh Baines <msb@...omium.org>
To:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] exec: log when wait_for_dump_helpers aborts due to a signal

On Tue, Oct 25, 2011 at 6:07 PM, 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.
>
> Alternatively, we may want to consider not aborting on a signal. You
> could always break the loop by killing the reader process.
>

Not checking for signal pending might not be such a bad idea. If you're stuck in
wait_for_dump_helpers, it means the reader is stuck so you'll want to kill it.
Once you kill the reader, the loop will exit naturally.

> Reference: http://crosbug.com/21559
> Signed-off-by: Mandeep Singh Baines <msb@...omium.org>
> Cc: Alexander Viro <viro@...iv.linux.org.uk>
> Cc: Neil Horman <nhorman@...driver.com>
> Cc: Earl Chew <earl_chew@...lent.com>
> Cc: Oleg Nesterov <oleg@...hat.com>
> Cc: Andi Kleen <andi@...stfloor.org>
> Cc: Alan Cox <alan@...rguk.ukuu.org.uk>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: linux-fsdevel@...r.kernel.org
> ---
>  fs/exec.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/fs/exec.c b/fs/exec.c
> index 25dcbe5..5d4190d 100644
> --- 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;
> +               }
> +
>                wake_up_interruptible_sync(&pipe->wait);
>                kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
>                pipe_wait(pipe);
> --
> 1.7.3.1
>
>
--
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