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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 26 Nov 2009 15:50:51 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Ananth N Mavinakayanahalli <ananth@...ibm.com>
Cc:	Alexey Dobriyan <adobriyan@...il.com>,
	Christoph Hellwig <hch@...radead.org>,
	"Frank Ch. Eigler" <fche@...hat.com>, Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Roland McGrath <roland@...hat.com>,
	linux-kernel@...r.kernel.org, utrace-devel@...hat.com,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: powerpc: fork && stepping (Was: [RFC,PATCH 0/14] utrace/ptrace)

I changed the subject. This bug has nothing to do with utrace,
the kernel fails with or without these changes.

On 11/26, Ananth N Mavinakayanahalli wrote:
>
> On Wed, Nov 25, 2009 at 04:40:52PM +0100, Oleg Nesterov wrote:
> > On 11/25, Ananth N Mavinakayanahalli wrote:
> > >
> > > step-fork: step-fork.c:56: handler_fail: Assertion `0' failed.
> > > /bin/sh: line 5: 24803 Aborted                 ${dir}$tst
> > > FAIL: step-fork
> >
> > This is expected. Should be fixed by
> >
> > 	ptrace-copy_process-should-disable-stepping.patch
> >
> > in -mm tree. (I am attaching this patch below just in case)
> > I din't mention this patch in this series because this bug
> > is "ortogonal" to utrace/ptrace.
>
> The patch doesn't seem to fix the issue on powerpc:
>
> step-fork: step-fork.c:56: handler_fail: Assertion `0' failed.
> /bin/sh: line 5: 17325 Aborted                 ${dir}$tst
> FAIL: step-fork

Good to know, thanks again Ananth.

I'll take a look. Since I know nothing about powerpc, I can't
promise the quick fix ;)

The bug was found by code inspection, but the fix is not trivial
because it depends on arch/, and it turns out the arch-independent
fix in

	ptrace-copy_process-should-disable-stepping.patch
	http://marc.info/?l=linux-mm-commits&m=125789789322573

doesn't work.

Ananth, could you please run the test-case from the changelog
below ? I do not really expect this can help, but just in case.

Oleg.

#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <assert.h>

int main(void)
{
	int pid, status;

	if (!(pid = fork())) {
		assert(ptrace(PTRACE_TRACEME) == 0);
		kill(getpid(), SIGSTOP);

		if (!fork()) {
			/* kernel bug: this child will be killed by SIGTRAP */
			printf("Hello world\n");
			return 43;
		}

		wait(&status);
		return WEXITSTATUS(status);
	}

	for (;;) {
		assert(pid == wait(&status));
		if (WIFEXITED(status))
			break;
		assert(ptrace(PTRACE_SINGLESTEP, pid, 0,0) == 0);
	}

	assert(WEXITSTATUS(status) == 43);
	return 0;
}

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