Skip to content

Commit

Permalink
Make sure futex_time64() is defined before attempting to use it.
Browse files Browse the repository at this point in the history
It's not present on Debian 8. (Linux 3.16.0, libseccomp 2.2.3)
  • Loading branch information
GerbilSoft committed Feb 1, 2025
1 parent 4cac03b commit b99b902
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/gtk/thumbnailer-dbus/rptsecure.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ int rpt_do_security_options(void)
SCMP_SYS(fcntl), SCMP_SYS(fcntl64), // gcc profiling
SCMP_SYS(ftruncate), // LibRpBase::RpFile::truncate() [from LibRpBase::RpPngWriterPrivate ctors]
SCMP_SYS(ftruncate64),
SCMP_SYS(futex), SCMP_SYS(futex_time64), // iconv_open(), dlopen()
SCMP_SYS(futex), // iconv_open(), dlopen()
#if defined(__SNR_futex_time64) || defined(__NR_futex_time64)
SCMP_SYS(futex_time64), // iconv_open(), dlopen()
#endif /* __SNR_futex_time64 || __NR_futex_time64 */
SCMP_SYS(gettimeofday), // 32-bit only?
SCMP_SYS(getppid), // dll-search.c: walk_proc_tree()
SCMP_SYS(getuid), // TODO: Only use geteuid()?
Expand Down
5 changes: 4 additions & 1 deletion src/librpbase/tests/gtest_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ int RP_C_API _tmain(int argc, TCHAR *argv[])
SCMP_SYS(clock_gettime64),
#endif /* __SNR_clock_gettime64 || __NR_clock_gettime64 */
SCMP_SYS(fcntl), SCMP_SYS(fcntl64), // gcc profiling
SCMP_SYS(futex), SCMP_SYS(futex_time64), // iconv_open()
SCMP_SYS(futex), // iconv_open()
#if defined(__SNR_futex_time64) || defined(__NR_futex_time64)
SCMP_SYS(futex_time64), // iconv_open()
#endif /* __SNR_futex_time64 || __NR_futex_time64 */
SCMP_SYS(gettimeofday), // 32-bit only? [testing::internal::GetTimeInMillis()]
SCMP_SYS(mmap), // iconv_open()
SCMP_SYS(mmap2), // iconv_open() [might only be needed on i386...]
Expand Down
5 changes: 4 additions & 1 deletion src/rp-download/rp-download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ int RP_C_API _tmain(int argc, TCHAR *argv[])
SCMP_SYS(close),
SCMP_SYS(fcntl), SCMP_SYS(fcntl64), // gcc profiling
SCMP_SYS(fsetxattr),
SCMP_SYS(futex), SCMP_SYS(futex_time64),
SCMP_SYS(futex),
#if defined(__SNR_futex_time64) || defined(__NR_futex_time64)
SCMP_SYS(futex_time64)
#endif /* __SNR_futex_time64 || __NR_futex_time64 */
SCMP_SYS(getdents), SCMP_SYS(getdents64),
SCMP_SYS(getppid), // for bubblewrap verification
SCMP_SYS(getrusage),
Expand Down
5 changes: 4 additions & 1 deletion src/rp-stub/rp-stub_secure.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ int rp_stub_do_security_options(bool config)
SCMP_SYS(dup), // gzdopen()
SCMP_SYS(ftruncate), // LibRpBase::RpFile::truncate() [from LibRpBase::RpPngWriterPrivate ctors]
SCMP_SYS(ftruncate64),
SCMP_SYS(futex), SCMP_SYS(futex_time64), // pthread_once()
SCMP_SYS(futex), // pthread_once()
#if defined(__SNR_futex_time64) || defined(__NR_futex_time64)
SCMP_SYS(futex_time64), // pthread_once()
#endif /* __SNR_futex_time64 || __NR_futex_time64 */
SCMP_SYS(getuid), SCMP_SYS(geteuid), // TODO: Only use geteuid()?
SCMP_SYS(lseek), SCMP_SYS(_llseek),
SCMP_SYS(lstat), SCMP_SYS(lstat64), // realpath() [LibRpBase::FileSystem::resolve_symlink()]
Expand Down
5 changes: 4 additions & 1 deletion src/rpcli/rpcli_secure.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ int rpcli_do_security_options(void)
SCMP_SYS(fcntl), SCMP_SYS(fcntl64), // gcc profiling
SCMP_SYS(ftruncate), // LibRpBase::RpFile::truncate() [from LibRpBase::RpPngWriterPrivate ctors]
SCMP_SYS(ftruncate64),
SCMP_SYS(futex), SCMP_SYS(futex_time64),
SCMP_SYS(futex),
#if defined(__SNR_futex_time64) || defined(__NR_futex_time64)
SCMP_SYS(futex_time64),
#endif /* __SNR_futex_time64 || __NR_futex_time64 */
SCMP_SYS(gettimeofday), // 32-bit only?
SCMP_SYS(ioctl), // for devices; also afl-fuzz
SCMP_SYS(lseek), SCMP_SYS(_llseek),
Expand Down

0 comments on commit b99b902

Please sign in to comment.