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:	Mon, 10 Mar 2008 22:26:38 +0100
From:	Stephan Diestelhorst <langer_mann@....de>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	Ingo Molnar <mingo@...e.hu>, davej@...emonkey.org.uk,
	cpufreq@...ts.linux.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] Speedfreq-SMI call clobbers ECX

Andi Kleen wrote:
> Stephan Diestelhorst <langer_mann@....de> writes:
> > 
> > New attempt with full clobbers, note that I deliberatly did not change
> > the order of the output registers. Real output operands still preceede
> > outputs used for potential clobbering.
> > 
> > I'm not too sure about the EBP push/pop frame, but as folks pointed
> > out already, we should not trust the SMI code too much.
> 
> Be careful -- older gcc versions tend to abort for inline asm
> that clobbers too many registers. Especially when the register
> is already used (like ebp in a frame pointer enabled kernel) 

AFAIK clobbering ebp is silently ignored on the GCCs I've tried it
on (regardles of frame-pointer ommission). Hence there is a hard-coded
push & pop for that register.

Please also note that these are not clobbers in the strict inline asm
syntax, but rather dummy output values that correspond to actual
input parameters. I'd consider this a serious compiler flaw, if not
bug, if these would not work. But let's not get into GCC vs.
Fancy-inline-asm-hacker flames, like the mplayer folks do ;-)

> Make sure it at least works on the oldest supported gcc version 
> (gcc 3.2) and with frame pointer on.

As I've said, I do not expect this to be problematic, but will test,
just to be sure! 

> For asms with so many clobbers explicit push/pop is usually safer.

Yes, but it is unneccessary overhead as the compiler can (should!)
find more elegant ways to get those registers back if needed.

Regards,
  Stephan
--
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