Commit dfa1d636 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

kdat: check compat support by EEXIST error

More reliable way to check support of mapping 32-bit blob.

travis-ci: success for Rectify 32-bit compatible C/R on x86
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent fa2e8f76
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "images/creds.pb-c.h" #include "images/creds.pb-c.h"
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
/* Remaps 64-bit vDSO on the same addr, where it already is */
int kdat_compat_sigreturn_test(void) int kdat_compat_sigreturn_test(void)
{ {
unsigned long auxval; unsigned long auxval;
...@@ -41,14 +40,13 @@ int kdat_compat_sigreturn_test(void) ...@@ -41,14 +40,13 @@ int kdat_compat_sigreturn_test(void)
return 0; return 0;
} }
/* /*
* Mapping vDSO on very low unaligned address (1). * Mapping vDSO while have not unmap it yet:
* We will get ENOMEM or EPERM if ARCH_MAP_VDSO_* exist, * this is restricted by API if ARCH_MAP_VDSO_* is supported.
* and ENOSYS if patches aren't in kernel.
*/ */
ret = syscall(SYS_arch_prctl, ARCH_MAP_VDSO_32, 1); ret = syscall(SYS_arch_prctl, ARCH_MAP_VDSO_32, 1);
if (ret == -1 && errno == ENOSYS) if (ret == -1 && errno == EEXIST)
return 0; return 1;
return 1; return 0;
} }
#endif /* CONFIG_X86_64 */ #endif /* CONFIG_X86_64 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment