[3/5] zdtm/vdso/ia32: Ignore vsyscall page appear

Submitted by Dmitry Safonov on May 2, 2019, 1:34 a.m.

Details

Message ID 20190502013445.528-4-dima@arista.com
State Accepted
Series "ia32/zdtm: A couple of 32bit fixes"
Commit 59c85752bdcbf9848d0dbc2b06f53d16e0dac3b9
Headers show

Commit Message

Dmitry Safonov May 2, 2019, 1:34 a.m.
Not a major bummer.
On the other side, it's also becomes less important as it seems that
distribution switches from LEGACY_VSYSCALL_EMULATE to
LEGACY_VSYSCALL_NONE (by security reasons).
Might be not worth fixing at all in the end.

Signed-off-by: Dmitry Safonov <dima@arista.com>
---
 test/zdtm/static/vdso-proxy.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/vdso-proxy.c b/test/zdtm/static/vdso-proxy.c
index 66d6741f4b2d..ecb71e892116 100644
--- a/test/zdtm/static/vdso-proxy.c
+++ b/test/zdtm/static/vdso-proxy.c
@@ -8,7 +8,7 @@  const char *test_doc	= "Compare mappings before/after C/R for vdso/vvar presence
 const char *test_author	= "Dmitry Safonov <dsafonov@virtuozzo.com>";
 
 #define BUILD_BUG_ON(condition)	((void)sizeof(char[1 - 2*!!(condition)]))
-#define VDSO_BAD_ADDR		(-1ul)
+#define VSYSCALL_START 0xffffffffff600000ULL
 /*
  * Use constant MAX_VMAS - to minimize the risk of allocating a new
  * mapping or changing the size of existent VMA with realloc()
@@ -55,6 +55,18 @@  static int parse_maps(struct vm_area *vmas)
 
 		v->start = strtoull(buf, &end, 16);
 		v->end = strtoull(end + 1, NULL, 16);
+
+#if defined(__i386__)
+		/*
+		 * XXX: ia32 is being restored from x86_64 and leaves
+		 * emulated vsyscall "mapping". Hopefully, will be done
+		 * per-process, ignore for now.
+		 */
+		if (v->start == VSYSCALL_START) {
+			i--;
+			continue;
+		}
+#endif
 		v->is_vvar_or_vdso |= strstr(buf, "[vdso]") != NULL;
 		v->is_vvar_or_vdso |= strstr(buf, "[vvar]") != NULL;
 		test_msg("[NOTE]\tVMA: [%#" PRIx64 ", %#" PRIx64 "]\n",