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:	Sun, 28 Apr 2013 00:44:56 -0500
From:	Jacob Shin <jacob.shin@....com>
To:	Oleg Nesterov <oleg@...hat.com>
CC:	Ingo Molnar <mingo@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>, <x86@...nel.org>,
	Stephane Eranian <eranian@...gle.com>,
	Jiri Olsa <jolsa@...hat.com>, <linux-kernel@...r.kernel.org>,
	Will Deacon <will.deacon@....com>
Subject: Re: [PATCH 2/3] perf tools: allow user to specify hardware
 breakpoint bp_len

On Sat, Apr 27, 2013 at 07:34:24PM +0200, Oleg Nesterov wrote:
> On 04/27, Oleg Nesterov wrote:
> >
> > On 04/26, Jacob Shin wrote:
> > >
> > > @@ -518,12 +518,10 @@ int parse_events_add_breakpoint(struct list_head **list, int *idx,
> > >  	if (parse_breakpoint_type(type, &attr))
> > >  		return -EINVAL;
> > >
> > > -	/*
> > > -	 * We should find a nice way to override the access length
> > > -	 * Provide some defaults for now
> > > -	 */
> > >  	if (attr.bp_type == HW_BREAKPOINT_X)
> > >  		attr.bp_len = sizeof(long);
> > > +	else if (len)
> > > +		attr.bp_len = len;
> > >  	else
> > >  		attr.bp_len = HW_BREAKPOINT_LEN_4;
> >
> > Stupid question... So X86_FEATURE_BPEXT only works for r/w? I mean, it
> > doesn't allow to specify the mask for an execute breakpoint?

Yes, it does work with instruction execution breakpoints as well.

> >
> > Otherwise the code above should be probably updated, say,
> >
> > 	if (!len) {
> > 		len = attr.bp_type == HW_BREAKPOINT_X ?
> > 			sizeof(long) : HW_BREAKPOINT_LEN_4;
> > 	}
> > 	attr.bp_len = len;
> 
> OK, we can't do this until we change arch_build_bp_info() which
> insists on sizeof(long) and sets X86_BREAKPOINT_LEN_X == 1.

Right, for instruction execution breakpoints, it is a x86 requirement
to have length as 1. Which makes sense, because you really want to be
trapping on 1 specifc IP.

Now using this new mask MSR, we should be able to trap on range of IPs,
but yeah since we are naturally extending bp_len .... we'll tackle it
later when we can come up with a good scheme to express masks in arch
neutral/general way.

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