mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 22:28:22 +00:00
gst: clock: Block futex_time64 usage on Android API level < 30
This syscall is seccomp blocked on all lower API levels:
ee7bc3002d
While at it, also fix all direct tests on __NR_futex_time64 and
__NR_futex so that they refer to the results available in
config.h.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6518>
This commit is contained in:
parent
25dc99f81f
commit
a1c30bc6a6
2 changed files with 15 additions and 7 deletions
|
@ -250,8 +250,12 @@ gst_futex_cond_broadcast (guint * cond_val)
|
|||
{
|
||||
g_atomic_int_inc (cond_val);
|
||||
|
||||
#if defined(__NR_futex_time64)
|
||||
#if defined(HAVE_FUTEX_TIME64)
|
||||
#if defined(__BIONIC__)
|
||||
if (__builtin_available (android 30, *)) {
|
||||
#else
|
||||
{
|
||||
#endif
|
||||
int res;
|
||||
res = syscall (__NR_futex_time64, cond_val, (gsize) FUTEX_WAKE_PRIVATE,
|
||||
(gsize) INT_MAX, NULL);
|
||||
|
@ -260,7 +264,7 @@ gst_futex_cond_broadcast (guint * cond_val)
|
|||
* normal `futex` syscall. This can happen if newer kernel headers are
|
||||
* used than the kernel that is actually running.
|
||||
*/
|
||||
#ifdef __NR_futex
|
||||
#if defined(HAVE_FUTEX)
|
||||
if (res >= 0 || errno != ENOSYS) {
|
||||
#else
|
||||
{
|
||||
|
@ -270,7 +274,7 @@ gst_futex_cond_broadcast (guint * cond_val)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(__NR_futex)
|
||||
#if defined(HAVE_FUTEX)
|
||||
syscall (__NR_futex, cond_val, (gsize) FUTEX_WAKE_PRIVATE, (gsize) INT_MAX,
|
||||
NULL);
|
||||
#endif
|
||||
|
@ -308,8 +312,12 @@ gst_futex_cond_wait_until (guint * cond_val, GMutex * mutex, gint64 end_time)
|
|||
* define `__NR_futex_time64`.
|
||||
*/
|
||||
|
||||
#ifdef __NR_futex_time64
|
||||
#if defined(HAVE_FUTEX_TIME64)
|
||||
#if defined(__BIONIC__)
|
||||
if (__builtin_available (android 30, *)) {
|
||||
#else
|
||||
{
|
||||
#endif
|
||||
struct
|
||||
{
|
||||
gint64 tv_sec;
|
||||
|
@ -329,7 +337,7 @@ gst_futex_cond_wait_until (guint * cond_val, GMutex * mutex, gint64 end_time)
|
|||
* normal `futex` syscall. This can happen if newer kernel headers are
|
||||
* used than the kernel that is actually running.
|
||||
*/
|
||||
#ifdef __NR_futex
|
||||
#if defined(HAVE_FUTEX)
|
||||
if (res >= 0 || errno != ENOSYS) {
|
||||
#else
|
||||
{
|
||||
|
@ -342,7 +350,7 @@ gst_futex_cond_wait_until (guint * cond_val, GMutex * mutex, gint64 end_time)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __NR_futex
|
||||
#if defined(HAVE_FUTEX)
|
||||
{
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -313,7 +313,7 @@ if cc.compiles('''#include <linux/futex.h>
|
|||
int main (int argc, char ** argv) {
|
||||
syscall (__NR_futex_time64, NULL, FUTEX_WAKE, FUTEX_WAIT);
|
||||
return 0;
|
||||
}''', name : 'futex(2) system call')
|
||||
}''', name : 'futex_time64(2) system call')
|
||||
cdata.set('HAVE_FUTEX_TIME64', 1)
|
||||
endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue