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: <201106161056.17798.pedro@codesourcery.com>
Date:	Thu, 16 Jun 2011 10:56:17 +0100
From:	Pedro Alves <pedro@...esourcery.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Denys Vlasenko <vda.linux@...glemail.com>,
	Oleg Nesterov <oleg@...hat.com>, jan.kratochvil@...hat.com,
	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org, indan@....nu, bdonlan@...il.com
Subject: Re: [PATCHSET ptrace] ptrace: implement PTRACE_SEIZE/INTERRUPT and group stop notification, take#4

Hi Tejun,

On Thursday 16 June 2011 09:38:28, Tejun Heo wrote:
> On Fri, Jun 03, 2011 at 11:25:15AM +0100, Pedro Alves wrote:
> > It'd be _very_ useful for x86 (and others) to have
> > something like TRAP_BRKPT for int3.  Both for ptracers
> > and in-process self debuggers.
> > 
> > I'd be super happy to be told we have that already
> > in recent kernels and I missed it.  :-)
> 
> Unfortunately, AFAICS, x86 doesn't have it nor is there a generic
> mechanism, but this should be solvable without disrupting existing
> users.

Hmm, looks like there was an earlier attempt:

<http://lkml.indiana.edu/hypermail/linux/kernel/0809.2/1898.html>

Reading that thread, there were some minor revisions, but I didn't
see any objection.  It seems that patch made it 2.6.28 (the only
sources I have handy), as I see get_si_code calls in arch/x86/kernel/traps.c,
and arch/x86/include/asm/traps.h.

But, I'm running 2.6.38, x86-64, and 

#include <stdio.h>
#include <string.h>
#include <signal.h>

static void
handler (int sig, siginfo_t *info, void *context)
{
  printf ("si_code = %x\n", info->si_code);
}

int
main (void)
{
  struct sigaction action;

  memset (&action, 0, sizeof (action));
  action.sa_sigaction = handler;
  action.sa_flags |= SA_SIGINFO;
  sigaction (SIGTRAP, &action, NULL);

  asm volatile ("int3");

  return 0;
}

still prints:

$ ./trap 
si_code = 80

Hmm...  I don't have any other kernel version sources or
git checkout handy at the moment to check the history
behind this.

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