mirror of git://sourceware.org/git/glibc.git
x86/cet: Check CPU_FEATURE_ACTIVE in permissive mode
Verify that CPU_FEATURE_ACTIVE works properly in permissive mode.
This commit is contained in:
parent
28bd6f832d
commit
4d8a01d2b0
|
|
@ -219,6 +219,7 @@ CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
|
||||||
CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
|
CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
|
||||||
CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
|
CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
|
||||||
CFLAGS-tst-cet-legacy-4.c += -fcf-protection=branch
|
CFLAGS-tst-cet-legacy-4.c += -fcf-protection=branch
|
||||||
|
CPPFLAGS-tst-cet-legacy-4a.c += -DCET_IS_PERMISSIVE=1
|
||||||
CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
|
CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
|
||||||
CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
|
CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
|
||||||
CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
|
CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <sys/platform/x86.h>
|
||||||
|
|
||||||
#include <support/check.h>
|
#include <support/check.h>
|
||||||
|
|
||||||
|
|
@ -40,6 +41,10 @@ do_test (void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CET_IS_PERMISSIVE
|
||||||
|
TEST_VERIFY (!CPU_FEATURE_ACTIVE (IBT) && !CPU_FEATURE_ACTIVE (SHSTK));
|
||||||
|
#endif
|
||||||
|
|
||||||
fp = dlsym (h, "test");
|
fp = dlsym (h, "test");
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
FAIL_EXIT1 ("cannot get symbol 'test': %s\n", dlerror ());
|
FAIL_EXIT1 ("cannot get symbol 'test': %s\n", dlerror ());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue