Re: New vsyscall emulation breaks JITs

From: Andi Kleen
Date: Fri Aug 05 2011 - 16:47:47 EST


On Fri, Aug 05, 2011 at 01:36:48PM -0700, H. Peter Anvin wrote:
> On 08/05/2011 01:26 PM, Andi Kleen wrote:
> >> I have to say I believe that trying to JIT the vdso or vsyscall pages is
> >> extremely dubious at best. They are fundamentally different from normal
> >> user space in that the kernel can muck with them any time, without
> >> notifying userspace about it. The other aspect of this is that this is
> >> about the legacy vsyscall page, which we're trying to get rid of, partly
> >> because of security problems.
> >
> > There's clear evidence now you can't: it's used even by new binaries.
>
> time() is not supported by vdso; this is a problem. Getting rid of it
> is a long-term thing.

Yes you're right the problem is time. I set a breakpoint on the vsyscalls
and I get:

(gdb) bt
#0 0xffffffffff600400 in ?? ()
#1 0x00007fffe4f703fd in time () at ../sysdeps/unix/sysv/linux/x86_64/time.S:36
...

This is with a very new glibc, in fact a recent git version.

So clearly it's all broken and even outside JITs everyone using time()
will be slow and if they use JITs don't work at all.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/