summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorJonathan Callen <abcd@gentoo.org>2012-07-24 22:45:22 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-19 12:03:06 -0500
commit843fc7f7f26a6507fe896a79ed1b474c35c4300f (patch)
treebd465b18a828d0abbc5505f2d63fc7ccb5817208 /Makefile.am
parent25da63b9dac8f166ebf390ca92d1de18fbfc9d11 (diff)
execute: Fix seccomp support on x32
In the x32 ABI, syscall numbers start at 0x40000000. Mask that bit on x32 for lookups in the syscall_names array and syscall_filter and ensure that syscall.h is parsed correctly. [zj: added SYSCALL_TO_INDEX, INDEX_TO_SYSCALL macros.]
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index ba93db0d82..2631748f61 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1099,7 +1099,7 @@ BUILT_SOURCES += \
src/core/syscall-list.txt: Makefile
$(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+\(?.*[0-9]+.*\)?/ { sub(/__NR_/, "", $$2); print $$2; }' > $@
+ $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9(]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@
src/core/syscall-from-name.gperf: src/core/syscall-list.txt Makefile
$(AM_V_at)$(MKDIR_P) $(dir $@)
@@ -1111,7 +1111,7 @@ src/core/syscall-from-name.h: src/core/syscall-from-name.gperf Makefile
src/core/syscall-to-name.h: src/core/syscall-list.txt Makefile
$(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const syscall_names[] = { "} { printf "[__NR_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
+ $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const syscall_names[] = { "} { printf "[SYSCALL_TO_INDEX(__NR_%s)] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
# ------------------------------------------------------------------------------
systemd_SOURCES = \