Re: [RFC][PATCH] linux-2.6.2_vsyscall-gtod_B2.patch

From: Andrea Arcangeli
Date: Thu Feb 05 2004 - 23:03:03 EST


On Thu, Feb 05, 2004 at 07:10:46PM -0800, john stultz wrote:
> @@ -6,6 +9,8 @@
> .globl __kernel_vsyscall
> .type __kernel_vsyscall,@function
> __kernel_vsyscall:
> + cmp $__NR_gettimeofday, %eax
> + je .Lvgettimeofday
> .LSTART_vsyscall:

this is the sort of slowdown that could be avoided with the fixed
address.

with regards to Ulrich's security related comments, this won't make any
difference compared to the fixed address version either, since the
vsyscall page is still at a fixed address in the fixmap area, and
nevertheless regardless the vgettimeofday api, the sysenter instruction
is always placed at a fixed address in the address space for the
sysenter vsyscall support, so at the light of the i386 current status,
those comments w.r.t to security make even less sense.

This has the feature that it doesn't need the LD_PRELOAD and it's sort
of backwards compatible, but it is equivalent in terms of security and
as a matter of fact it's less efficient and the worst part is that not
only it makes gettimeofday slower, it makes _all_ the syscall slower
(slowing down vgettimeofday wouldn't matter since we're improving it
huge anyways).

I prefer the previous version, glibc has to be changed at the same time
with the kernel anyways to use the sysenter. I think it's not nice to
speedup gettimeofday by slowing down all other syscalls, when we can
implement it running all syscalls at full speed with the optimal API of
x86-64.
-
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/