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:	Thu, 19 Jan 2012 09:58:20 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Jason Baron <jbaron@...hat.com>
Subject: Re: [PATCH 2/2] jump labels/x86: Use etiher 5 byte or 2 byte jumps

On Thu, 2012-01-19 at 06:46 -0800, H. Peter Anvin wrote:

> >>  				   void *(*poker)(void *, const void *, size_t))
> >>  {
> >>  	union jump_code_union code;
> >> +	unsigned char nop;
> >> +	unsigned char op;
> >> +	unsigned size;
> >> +	void *ip = (void *)entry->code;
> >> +	void *ideal = (void *)ideal_nops[NOP_ATOMIC5];
> > 
> > "void *" should possibly be "unsigned char *" here to respect the nop
> > place-holder typing.
> > 
> 
> const unsigned char * please.

OK.

> 
> >> +
> >> +	/* Use probe_kernel_read()? */
> >> +	op = *(unsigned char *)ip;
> >> +	nop = ideal_nops[NOP_ATOMIC5][0];
> >>  
> >>  	if (type == JUMP_LABEL_ENABLE) {
> >> -		code.jump = 0xe9;
> >> -		code.offset = entry->target -
> >> -				(entry->code + JUMP_LABEL_NOP_SIZE);
> >> -	} else
> >> -		memcpy(&code, ideal_nops[NOP_ATOMIC5], JUMP_LABEL_NOP_SIZE);
> >> +		if (op == 0xe9 || op == 0xeb)
> >> +			/* Already enabled. Warn? */
> > 
> > This could be caused by failure to run the link-time script, or running
> > the transform twice. A warning would indeed be welcome, as this should
> > never happen.
> > 
> 
> Warning?  No.  ERROR.  Something very bad could be happening here.  We
> have covered this before.

Heh, not this exactly. We covered run time errors, this is build time
errors.

But I agree, it should error. The mcount code errors on problems, this
should too.

-- Steve


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