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 @@
#include "images/creds.pb-c.h"
#ifdef CONFIG_X86_64
/* Remaps 64-bit vDSO on the same addr, where it already is */
int kdat_compat_sigreturn_test(void)
{
unsigned long auxval;
......@@ -41,14 +40,13 @@ int kdat_compat_sigreturn_test(void)
return 0;
}
/*
* Mapping vDSO on very low unaligned address (1).
* We will get ENOMEM or EPERM if ARCH_MAP_VDSO_* exist,
* and ENOSYS if patches aren't in kernel.
* Mapping vDSO while have not unmap it yet:
* this is restricted by API if ARCH_MAP_VDSO_* is supported.
*/
ret = syscall(SYS_arch_prctl, ARCH_MAP_VDSO_32, 1);
if (ret == -1 && errno == ENOSYS)
return 0;
return 1;
if (ret == -1 && errno == EEXIST)
return 1;
return 0;
}
#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