Commit 10859f38 authored by Kees Cook's avatar Kees Cook Committed by Shuah Khan

selftests/seccomp: Support glibc 2.26 siginfo_t.h

The 2.26 release of glibc changed how siginfo_t is defined, and the earlier
work-around to using the kernel definition are no longer needed. The old
way needs to stay around for a while, though.
Reported-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Will Drewry <wad@chromium.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Tested-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent 659dbfd8
...@@ -6,10 +6,18 @@ ...@@ -6,10 +6,18 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <asm/siginfo.h>
#define __have_siginfo_t 1 /*
#define __have_sigval_t 1 * glibc 2.26 and later have SIGSYS in siginfo_t. Before that,
#define __have_sigevent_t 1 * we need to use the kernel's siginfo.h file and trick glibc
* into accepting it.
*/
#if !__GLIBC_PREREQ(2, 26)
# include <asm/siginfo.h>
# define __have_siginfo_t 1
# define __have_sigval_t 1
# define __have_sigevent_t 1
#endif
#include <errno.h> #include <errno.h>
#include <linux/filter.h> #include <linux/filter.h>
...@@ -676,7 +684,7 @@ TEST_F_SIGNAL(TRAP, ign, SIGSYS) ...@@ -676,7 +684,7 @@ TEST_F_SIGNAL(TRAP, ign, SIGSYS)
syscall(__NR_getpid); syscall(__NR_getpid);
} }
static struct siginfo TRAP_info; static siginfo_t TRAP_info;
static volatile int TRAP_nr; static volatile int TRAP_nr;
static void TRAP_action(int nr, siginfo_t *info, void *void_context) static void TRAP_action(int nr, siginfo_t *info, void *void_context)
{ {
......
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