mailing list of musl libc
 help / color / mirror / code / Atom feed
* [RFC PATCH v2 2/2] avoid invoking vDSO when separate stack segment is enabled
@ 2016-10-28 20:14 LeMay, Michael
  0 siblings, 0 replies; only message in thread
From: LeMay, Michael @ 2016-10-28 20:14 UTC (permalink / raw)
  To: musl

The Linux vDSO code may be incompatible with programs that use a
separate stack segment.  This patch prevents the vDSO from being
invoked when that feature is enabled.

Signed-off-by: Michael LeMay <michael.lemay@intel.com>
---
 arch/i386/syscall_arch.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/i386/syscall_arch.h b/arch/i386/syscall_arch.h
index 4c9d874..4d7c3c2 100644
--- a/arch/i386/syscall_arch.h
+++ b/arch/i386/syscall_arch.h
@@ -52,8 +52,17 @@ static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a
 	return __ret;
 }
 
+#if !SEP_STACK_SEG
+/* The vDSO may not be compiled with support for a separate stack segment.
+ * Avoid invoking the vDSO when this feature is enabled, since it may try to
+ * access the stack using memory operands with base registers other than EBP or
+ * ESP without also using a stack segment override prefix.  A special compiler
+ * pass needs to be used to add such prefixes, and it is unlikely that a pass
+ * of that sort was applied when the vDSO was compiled.
+ */
 #define VDSO_USEFUL
 #define VDSO_CGT_SYM "__vdso_clock_gettime"
 #define VDSO_CGT_VER "LINUX_2.6"
+#endif
 
 #define SYSCALL_USE_SOCKETCALL
-- 
2.7.4



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-28 20:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 20:14 [RFC PATCH v2 2/2] avoid invoking vDSO when separate stack segment is enabled LeMay, Michael

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).