summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-05-23 15:26:19 +0000
committerJohn Crispin <john@openwrt.org>2015-05-23 15:26:19 +0000
commit6ab2bcfe72dbe442bf74cd4e1208367104699e00 (patch)
tree8ee009c8e7db008ab787fc0ea86fa6f7ad335578 /toolchain
parent86b573fa31e0cad026f0d5e8838bbe96f671b023 (diff)
downloadmtk-20170518-6ab2bcfe72dbe442bf74cd4e1208367104699e00.zip
mtk-20170518-6ab2bcfe72dbe442bf74cd4e1208367104699e00.tar.gz
mtk-20170518-6ab2bcfe72dbe442bf74cd4e1208367104699e00.tar.bz2
uClibc: add signal info for seccomp related SIGSYS
uClibc doesn't define signal info for the SIGSYS signal which is issued in case of hitting a syscall prohibited by seccomp. This is sad as it makes debugging seccomp filter policies impossible on some architectures (at least ARM and PowerPC, maybe also others) which do not coincidentally set si_value.sival_int as the syscall number. To fix this, import the definitions and macros needed from glibc. Signed-off-by: Daniel Golle <daniel@makrotopia.org> SVN-Revision: 45720
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/uClibc/patches-0.9.33.2/995-add-sigsys-to-siginfo_t-union.patch145
1 files changed, 145 insertions, 0 deletions
diff --git a/toolchain/uClibc/patches-0.9.33.2/995-add-sigsys-to-siginfo_t-union.patch b/toolchain/uClibc/patches-0.9.33.2/995-add-sigsys-to-siginfo_t-union.patch
new file mode 100644
index 0000000..4894a56
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.33.2/995-add-sigsys-to-siginfo_t-union.patch
@@ -0,0 +1,145 @@
+Index: uClibc/libc/sysdeps/linux/common/bits/siginfo.h
+===================================================================
+--- uClibc.orig/libc/sysdeps/linux/common/bits/siginfo.h
++++ uClibc/libc/sysdeps/linux/common/bits/siginfo.h
+@@ -104,6 +104,14 @@ typedef struct siginfo
+ long int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
++
++ /* SIGSYS. */
++ struct
++ {
++ void *_call_addr; /* Calling user insn. */
++ int _syscall; /* Triggering system call number. */
++ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
++ } _sigsys;
+ } _sifields;
+ } siginfo_t;
+
+@@ -122,6 +130,9 @@ typedef struct siginfo
+ # define si_addr _sifields._sigfault.si_addr
+ # define si_band _sifields._sigpoll.si_band
+ # define si_fd _sifields._sigpoll.si_fd
++# define si_call_addr _sifields._sigsys._call_addr
++# define si_syscall _sifields._sigsys._syscall
++# define si_arch _sifields._sigsys._arch
+
+
+ /* Values for `si_code'. Positive values are reserved for kernel-generated
+Index: uClibc/libc/sysdeps/linux/alpha/bits/siginfo.h
+===================================================================
+--- uClibc.orig/libc/sysdeps/linux/alpha/bits/siginfo.h
++++ uClibc/libc/sysdeps/linux/alpha/bits/siginfo.h
+@@ -98,6 +98,14 @@ typedef struct siginfo
+ int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
++
++ /* SIGSYS. */
++ struct
++ {
++ void *_call_addr; /* Calling user insn. */
++ int _syscall; /* Triggering system call number. */
++ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
++ } _sigsys;
+ } _sifields;
+ } siginfo_t;
+
+@@ -116,6 +124,9 @@ typedef struct siginfo
+ # define si_addr _sifields._sigfault.si_addr
+ # define si_band _sifields._sigpoll.si_band
+ # define si_fd _sifields._sigpoll.si_fd
++# define si_call_addr _sifields._sigsys._call_addr
++# define si_syscall _sifields._sigsys._syscall
++# define si_arch _sifields._sigsys._arch
+
+
+ /* Values for `si_code'. Positive values are reserved for kernel-generated
+Index: uClibc/libc/sysdeps/linux/ia64/bits/siginfo.h
+===================================================================
+--- uClibc.orig/libc/sysdeps/linux/ia64/bits/siginfo.h
++++ uClibc/libc/sysdeps/linux/ia64/bits/siginfo.h
+@@ -103,6 +103,14 @@ typedef struct siginfo
+ long int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
++
++ /* SIGSYS. */
++ struct
++ {
++ void *_call_addr; /* Calling user insn. */
++ int _syscall; /* Triggering system call number. */
++ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
++ } _sigsys;
+ } _sifields;
+ } siginfo_t;
+
+@@ -121,6 +129,9 @@ typedef struct siginfo
+ # define si_addr _sifields._sigfault.si_addr
+ # define si_band _sifields._sigpoll.si_band
+ # define si_fd _sifields._sigpoll.si_fd
++# define si_call_addr _sifields._sigsys._call_addr
++# define si_syscall _sifields._sigsys._syscall
++# define si_arch _sifields._sigsys._arch
+
+ # ifdef __USE_GNU
+ # define si_imm _sifields._sigfault._si_imm
+Index: uClibc/libc/sysdeps/linux/mips/bits/siginfo.h
+===================================================================
+--- uClibc.orig/libc/sysdeps/linux/mips/bits/siginfo.h
++++ uClibc/libc/sysdeps/linux/mips/bits/siginfo.h
+@@ -107,6 +107,14 @@ typedef struct siginfo
+ __uid_t si_uid; /* Real user ID of sending process. */
+ sigval_t si_sigval; /* Signal value. */
+ } _rt;
++
++ /* SIGSYS. */
++ struct
++ {
++ void *_call_addr; /* Calling user insn. */
++ int _syscall; /* Triggering system call number. */
++ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
++ } _sigsys;
+ } _sifields;
+ } siginfo_t;
+
+@@ -123,6 +131,9 @@ typedef struct siginfo
+ # define si_addr _sifields._sigfault.si_addr
+ # define si_band _sifields._sigpoll.si_band
+ # define si_fd _sifields._sigpoll.si_fd
++# define si_call_addr _sifields._sigsys._call_addr
++# define si_syscall _sifields._sigsys._syscall
++# define si_arch _sifields._sigsys._arch
+
+
+ /* Values for `si_code'. Positive values are reserved for kernel-generated
+Index: uClibc/libc/sysdeps/linux/sparc/bits/siginfo.h
+===================================================================
+--- uClibc.orig/libc/sysdeps/linux/sparc/bits/siginfo.h
++++ uClibc/libc/sysdeps/linux/sparc/bits/siginfo.h
+@@ -105,6 +105,14 @@ typedef struct siginfo
+ int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
++
++ /* SIGSYS. */
++ struct
++ {
++ void *_call_addr; /* Calling user insn. */
++ int _syscall; /* Triggering system call number. */
++ unsigned int _arch; /* AUDIT_ARCH_* of syscall. */
++ } _sigsys;
+ } _sifields;
+ } siginfo_t;
+
+@@ -124,6 +132,9 @@ typedef struct siginfo
+ # define si_trapno _sifields._sigfault.si_trapno
+ # define si_band _sifields._sigpoll.si_band
+ # define si_fd _sifields._sigpoll.si_fd
++# define si_call_addr _sifields._sigsys._call_addr
++# define si_syscall _sifields._sigsys._syscall
++# define si_arch _sifields._sigsys._arch
+
+
+ /* Values for `si_code'. Positive values are reserved for kernel-generated