util: avoid calling kcmp on Android
On some combinations of Android version and kernel version, calling kcmp results in seccomp killing the process. As there doesn't seem to be a way to query for that in advance, skip this check altogether on Android. Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Rob Clark <robclark@freedesktop.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
This commit is contained in:

committed by
Marge Bot

parent
0d6c240fcc
commit
a72035f9c5
10
meson.build
10
meson.build
@@ -851,6 +851,16 @@ if with_platform_android
|
|||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# On Android, seccomp kills the process on kernels without
|
||||||
|
# CONFIG_KCMP/CONFIG_CHECKPOINT_RESTORE if it attemps to use KCMP.
|
||||||
|
# Since we can't detect that, err on the side of caution and disable
|
||||||
|
# KCMP by default on Android.
|
||||||
|
if get_option('allow-kcmp') \
|
||||||
|
.disable_auto_if(with_platform_android) \
|
||||||
|
.allowed()
|
||||||
|
pre_args += '-DALLOW_KCMP'
|
||||||
|
endif
|
||||||
|
|
||||||
prog_python = import('python').find_installation('python3')
|
prog_python = import('python').find_installation('python3')
|
||||||
has_mako = run_command(
|
has_mako = run_command(
|
||||||
prog_python, '-c',
|
prog_python, '-c',
|
||||||
|
@@ -427,6 +427,11 @@ option(
|
|||||||
value : 25,
|
value : 25,
|
||||||
description : 'Android Platform SDK version. Default: Nougat version.'
|
description : 'Android Platform SDK version. Default: Nougat version.'
|
||||||
)
|
)
|
||||||
|
option(
|
||||||
|
'allow-kcmp',
|
||||||
|
type : 'feature',
|
||||||
|
description : 'Allow using KCMP_FILE to compare file descriptions. auto = allowed everywhere except on Android'
|
||||||
|
)
|
||||||
option(
|
option(
|
||||||
'zstd',
|
'zstd',
|
||||||
type : 'feature',
|
type : 'feature',
|
||||||
|
@@ -194,7 +194,7 @@ os_read_file(const char *filename, size_t *size)
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DETECT_OS_LINUX
|
#if DETECT_OS_LINUX && ALLOW_KCMP
|
||||||
|
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
Reference in New Issue
Block a user