On Fri, Mar 25, 2011 at 01:36:13PM +0100, Mark Kettenis wrote:
> > Date: Tue, 15 Mar 2011 14:22:16 +0100
> > From: Aleksander Piotrowski <[email protected]>
> > i have signal 4, Illegal instruction crash on sparc64 with security/botan
> > (required by newer devel/monotone).  it looks like they are trying to get 
> > time
> > from hardware timer using some funny asm's.  sparc64 and asm are rocket 
> > science for me,
> > that's why i'm asking for your help :-)
> > 
> > here goes method body that, according to gdb, is our culprit.  and the 
> > exact line is
> > 
> >     asm volatile("rd %%tick, %0" : "=r" (rtc));

> On OpenBSD we disable access to %tick from userland.  I think the idea
> is to make it harder for people to perform timing attacks, and
> therefore improve security.  But I don't consider myself enough of a
> security expert to be able to judge wethere that really helps.  So I
> CC'ed tech@ in the hope that a more knowledgable person will chime in.

I don't know much about SPARCs, but on i386/amd64 the pctr(4) device -
or, if you want to reduce the noise from switching into the kernel, the
rdtsc instruction - works just fine. See
http://www.openbsd.org/cgi-bin/man.cgi?query=pctr&apropos=0&sektion=4&manpath=OpenBSD+Current&arch=i386&format=html
and /usr/include/machine/pctr.h on an appropriate machine. (rdpmc may be
convenient for cache-based attacks; see the output of "pctr -l" on an
appropriate machine. Of course, you can infer cache misses from the
instruction count, too.)

So if this is for security, it's at least not universal.

                Joachim

Reply via email to