diff options
| author | dyhkwong <dyhkwong@gmail.com> | 2026-02-28 02:01:24 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-02 10:41:58 -0800 |
| commit | a5f474fc062a3b9140febc802b6cc38cbebdd973 (patch) | |
| tree | 85887ee72a01757ad9bef56c1fd17ef7b861ad31 /src | |
| parent | 094aacdb047e716ea5598514222bc8c70843d49e (diff) | |
| download | go-a5f474fc062a3b9140febc802b6cc38cbebdd973.tar.xz | |
runtime: skip futex_time64 and timer_settime64 on 32-bit Android
In Android versions 8.0-10 (API levels 26-29), futex_time64 and
timer_settime64 are not in the allowlist of the seccomp filter and will
lead to a runtime crash.
Fixes #77621
Change-Id: I99607d7128c395edf93738440c2928b6819d8a21
Reviewed-on: https://go-review.googlesource.com/c/go/+/750040
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime/os_linux32.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/runtime/os_linux32.go b/src/runtime/os_linux32.go index 16de6fb350..748fc53c3f 100644 --- a/src/runtime/os_linux32.go +++ b/src/runtime/os_linux32.go @@ -21,7 +21,12 @@ var isFutexTime32bitOnly atomic.Bool //go:nosplit func futex(addr unsafe.Pointer, op int32, val uint32, ts *timespec, addr2 unsafe.Pointer, val3 uint32) int32 { - if !isFutexTime32bitOnly.Load() { + // In Android versions 8.0-10 (API levels 26-29), futex_time64 + // is not in the allowlist of the seccomp filter and will lead to a + // runtime crash. See issue 77621. + // TODO: Check Android version and do not skip futex_time64 + // on Android 11 or higher (API level 30+). + if GOOS != "android" && !isFutexTime32bitOnly.Load() { ret := futex_time64(addr, op, val, ts, addr2, val3) // futex_time64 is only supported on Linux 5.0+ if ret != -_ENOSYS { @@ -49,7 +54,12 @@ var isSetTime32bitOnly atomic.Bool //go:nosplit func timer_settime(timerid int32, flags int32, new, old *itimerspec) int32 { - if !isSetTime32bitOnly.Load() { + // In Android versions 8.0-10 (API levels 26-29), timer_settime64 + // is not in the allowlist of the seccomp filter and will lead to a + // runtime crash. See issue 77621. + // TODO: Check Android version and do not skip timer_settime64 + // on Android 11 or higher (API level 30+). + if GOOS != "android" && !isSetTime32bitOnly.Load() { ret := timer_settime64(timerid, flags, new, old) // timer_settime64 is only supported on Linux 5.0+ if ret != -_ENOSYS { |
