radv: fix radv secure compile feature breaks compilation on armhf EABI and aarch64
authorLuis Mendes <luis.p.mendes@gmail.com>
Sat, 9 Nov 2019 23:21:05 +0000 (23:21 +0000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 12 Nov 2019 00:47:20 +0000 (11:47 +1100)
__NR_select is not defined the same way across architectures, sometimes is
not even defined, like in armhf EABI and aarch64.

Signed-off-by: Luis Mendes <luis.p.mendes@gmail.com>
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2042
src/amd/vulkan/radv_device.c

index 93763c4ae4c7e2315ec768feba8e344437ea3432..a608c39c5e5d76a8944370196914a95cf4f581bd 100644 (file)
@@ -2006,8 +2006,16 @@ static int install_seccomp_filter() {
                BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, AUDIT_ARCH_X86_64, 0, 12),
 
                /* Futex is required for mutex locks */
+               #if defined __NR__newselect
+               BPF_STMT(BPF_LD + BPF_W + BPF_ABS, (offsetof(struct seccomp_data, nr))),
+               BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, __NR__newselect, 11, 0),
+               #elif defined __NR_select
                BPF_STMT(BPF_LD + BPF_W + BPF_ABS, (offsetof(struct seccomp_data, nr))),
                BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, __NR_select, 11, 0),
+               #else
+               BPF_STMT(BPF_LD + BPF_W + BPF_ABS, (offsetof(struct seccomp_data, nr))),
+               BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, __NR_pselect6, 11, 0),
+               #endif
 
                /* Allow system exit calls for the forked process */
                BPF_STMT(BPF_LD + BPF_W + BPF_ABS, (offsetof(struct seccomp_data, nr))),