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]
Message-ID: <4E27163A.6090102@mit.edu>
Date:	Wed, 20 Jul 2011 13:54:02 -0400
From:	Andy Lutomirski <luto@....EDU>
To:	Richard Weinberger <richard@....at>
CC:	user-mode-linux-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] um: Implement a x86_64 vDSO

On 07/18/2011 09:07 AM, Richard Weinberger wrote:
> Until now UML had no x86_64 vDSO.
> So glibc always used the vsyscall page for gettimeday()
> and friends.
> Calls to gettimeday() returned falsely the host time and
> confused some programs.
>
> This patch adds a vDSO which turns all __vdso_* calls into
> a system call so that UML can trap them.
>
> As glibc still uses the vsyscall page for static binaries this
> patch improves the situation only for dynamic binaries.
>
> Signed-off-by: Richard Weinberger<richard@....at>

> +	asm("syscall" : "=a" (ret) :
> +		"0" (__NR_clock_gettime), "D" (clock), "S" (ts) : "memory");
> +

The x86-64 ABI and glibc think that rcx, and r11 are clobbered.  glibc 
also thinks that cc is clobbered.  I personally think that rdx and 
r8-r15 ought to be clobbered under the principle that syscall should 
look like a function call.

It's hard to imagine this causing a problem in a function this trivial, 
though.

This applies to the other two syscall instructions as well.

--Andy

P.S.  If you really care, with the changes in tip/x86/vdso, it ought to 
be possible for UML to trap vsyscalls as well.  This would need a change 
to do_emulate_vsyscall to honor TIF_SYSCALL_EMU with intelligent 
semantics.  I know nothing about ptrace, so I'm not volunteering :)
--
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