[go] runtime: use Uname version check for 64bits time on 32bits arch codepaths

2 views
Skip to first unread message

Jorropo (Gerrit)

unread,
Mar 4, 2026, 3:42:40 AMMar 4
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Jorropo has uploaded the change for review

Commit message

runtime: use Uname version check for 64bits time on 32bits arch codepaths

The previous fallback on ENOSYS logic causes issues on forks on Linux.
Android: #77621 (CL 750040 added a workaround with a TODO, this fixes that TODO)
Causes the OS to terminate the program when running on Android versions <=10
since the seccomp jail does not know about the 64bits time syscall
and is configured to terminate the program on any unknown syscall.

Synology's Linux: #77930
On old versions of Synology's Linux they added custom vendor syscalls
without adding a gap in the syscall numbers, that means when we call
the newer Linux syscall which was added later, Synology's Linux
interpret it as a completely different syscall.

Fixes #77930
Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6

Change diff

diff --git a/src/internal/runtime/syscall/linux/defs_linux_386.go b/src/internal/runtime/syscall/linux/defs_linux_386.go
index 7fdf5d3..4e8e645 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_386.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_386.go
@@ -17,6 +17,7 @@
SYS_OPENAT = 295
SYS_PREAD64 = 180
SYS_READ = 3
+ SYS_UNAME = 122

EFD_NONBLOCK = 0x800

diff --git a/src/internal/runtime/syscall/linux/defs_linux_amd64.go b/src/internal/runtime/syscall/linux/defs_linux_amd64.go
index 2c8676e..fa764d9 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_amd64.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_amd64.go
@@ -17,6 +17,7 @@
SYS_OPENAT = 257
SYS_PREAD64 = 17
SYS_READ = 0
+ SYS_UNAME = 63

EFD_NONBLOCK = 0x800

diff --git a/src/internal/runtime/syscall/linux/defs_linux_arm.go b/src/internal/runtime/syscall/linux/defs_linux_arm.go
index a0b395d..cef556d 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_arm.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_arm.go
@@ -17,6 +17,7 @@
SYS_OPENAT = 322
SYS_PREAD64 = 180
SYS_READ = 3
+ SYS_UNAME = 122

EFD_NONBLOCK = 0x800

diff --git a/src/internal/runtime/syscall/linux/defs_linux_arm64.go b/src/internal/runtime/syscall/linux/defs_linux_arm64.go
index 223dce0..eabddba 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_arm64.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_arm64.go
@@ -17,6 +17,7 @@
SYS_OPENAT = 56
SYS_PREAD64 = 67
SYS_READ = 63
+ SYS_UNAME = 160

EFD_NONBLOCK = 0x800

diff --git a/src/internal/runtime/syscall/linux/defs_linux_loong64.go b/src/internal/runtime/syscall/linux/defs_linux_loong64.go
index 8aa61c3..08e5d49 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_loong64.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_loong64.go
@@ -17,6 +17,7 @@
SYS_OPENAT = 56
SYS_PREAD64 = 67
SYS_READ = 63
+ SYS_UNAME = 160

EFD_NONBLOCK = 0x800

diff --git a/src/internal/runtime/syscall/linux/defs_linux_mips64x.go b/src/internal/runtime/syscall/linux/defs_linux_mips64x.go
index 84b760d..b5794e5 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_mips64x.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_mips64x.go
@@ -19,6 +19,7 @@
SYS_OPENAT = 5247
SYS_PREAD64 = 5016
SYS_READ = 5000
+ SYS_UNAME = 5061

EFD_NONBLOCK = 0x80

diff --git a/src/internal/runtime/syscall/linux/defs_linux_mipsx.go b/src/internal/runtime/syscall/linux/defs_linux_mipsx.go
index a9be214..1fb4d91 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_mipsx.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_mipsx.go
@@ -19,6 +19,7 @@
SYS_OPENAT = 4288
SYS_PREAD64 = 4200
SYS_READ = 4003
+ SYS_UNAME = 4122

EFD_NONBLOCK = 0x80

diff --git a/src/internal/runtime/syscall/linux/defs_linux_ppc64x.go b/src/internal/runtime/syscall/linux/defs_linux_ppc64x.go
index 63f4e5d..ee93ad3 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_ppc64x.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_ppc64x.go
@@ -19,6 +19,7 @@
SYS_OPENAT = 286
SYS_PREAD64 = 179
SYS_READ = 3
+ SYS_UNAME = 122

EFD_NONBLOCK = 0x800

diff --git a/src/internal/runtime/syscall/linux/defs_linux_riscv64.go b/src/internal/runtime/syscall/linux/defs_linux_riscv64.go
index 8aa61c3..08e5d49 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_riscv64.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_riscv64.go
@@ -17,6 +17,7 @@
SYS_OPENAT = 56
SYS_PREAD64 = 67
SYS_READ = 63
+ SYS_UNAME = 160

EFD_NONBLOCK = 0x800

diff --git a/src/internal/runtime/syscall/linux/defs_linux_s390x.go b/src/internal/runtime/syscall/linux/defs_linux_s390x.go
index 52945db..da11c70 100644
--- a/src/internal/runtime/syscall/linux/defs_linux_s390x.go
+++ b/src/internal/runtime/syscall/linux/defs_linux_s390x.go
@@ -17,6 +17,7 @@
SYS_OPENAT = 288
SYS_PREAD64 = 180
SYS_READ = 3
+ SYS_UNAME = 122

EFD_NONBLOCK = 0x800

diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go
index 7e6af22..3db58ee 100644
--- a/src/runtime/os_linux.go
+++ b/src/runtime/os_linux.go
@@ -354,6 +354,7 @@
numCPUStartup = getCPUCount()
physHugePageSize = getHugePageSize()
vgetrandomInit()
+ configure64bitsTimeOn32BitsArchitectures()
}

var urandom_dev = []byte("/dev/urandom\x00")
@@ -935,3 +936,57 @@
r, _, err := linux.Syscall6(linux.SYS_MPROTECT, uintptr(addr), n, uintptr(prot), 0, 0, 0)
return int32(r), int32(err)
}
+
+type utsname struct {
+ Sysname [65]int8
+ Nodename [65]int8
+ Release [65]int8
+ Version [65]int8
+ Machine [65]int8
+ Domainname [65]int8
+}
+
+type kernelVersion struct {
+ major int
+ minor int
+}
+
+// getKernelVersion returns major and minor kernel version numbers
+// parsed from the syscall.Uname's Release field.
+func getKernelVersion() kernelVersion {
+ var uname utsname
+ if _, _, err := linux.Syscall6(linux.SYS_UNAME, uintptr(unsafe.Pointer(&uname)), 0, 0, 0, 0, 0); err != 0 {
+ throw("uname failed")
+ }
+
+ var (
+ values [2]int
+ value, vi int
+ )
+ for _, c := range uname.Release {
+ if '0' <= c && c <= '9' {
+ value = (value * 10) + int(c-'0')
+ } else {
+ // Note that we're assuming N.N.N here.
+ // If we see anything else, we are likely to mis-parse it.
+ values[vi] = value
+ vi++
+ if vi >= len(values) {
+ break
+ }
+ value = 0
+ }
+ }
+
+ if values[0] == 0 && values[1] == 0 {
+ throw("failed to parse kernel version from uname")
+ }
+
+ return kernelVersion{major: values[0], minor: values[1]}
+}
+
+// GE checks if the running kernel version
+// is greater than or equal to the provided version.
+func (kv kernelVersion) GE(x, y int) bool {
+ return kv.major > x || (kv.major == x && kv.minor >= y)
+}
diff --git a/src/runtime/os_linux32.go b/src/runtime/os_linux32.go
index 748fc53..02cb18f 100644
--- a/src/runtime/os_linux32.go
+++ b/src/runtime/os_linux32.go
@@ -7,32 +7,25 @@
package runtime

import (
- "internal/runtime/atomic"
"unsafe"
)

+func configure64bitsTimeOn32BitsArchitectures() {
+ use64bitsTimeOn32bits = getKernelVersion().GE(5, 1)
+}
+
//go:noescape
func futex_time32(addr unsafe.Pointer, op int32, val uint32, ts *timespec32, addr2 unsafe.Pointer, val3 uint32) int32

//go:noescape
func futex_time64(addr unsafe.Pointer, op int32, val uint32, ts *timespec, addr2 unsafe.Pointer, val3 uint32) int32

-var isFutexTime32bitOnly atomic.Bool
+var use64bitsTimeOn32bits bool

//go:nosplit
func futex(addr unsafe.Pointer, op int32, val uint32, ts *timespec, addr2 unsafe.Pointer, val3 uint32) int32 {
- // 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 {
- return ret
- }
- isFutexTime32bitOnly.Store(true)
+ if use64bitsTimeOn32bits {
+ return futex_time64(addr, op, val, ts, addr2, val3)
}
// Downgrade ts.
var ts32 timespec32
@@ -50,22 +43,10 @@
//go:noescape
func timer_settime64(timerid int32, flags int32, new, old *itimerspec) int32

-var isSetTime32bitOnly atomic.Bool
-
//go:nosplit
func timer_settime(timerid int32, flags int32, new, old *itimerspec) int32 {
- // 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 {
- return ret
- }
- isSetTime32bitOnly.Store(true)
+ if use64bitsTimeOn32bits {
+ return timer_settime64(timerid, flags, new, old)
}

var newts, oldts itimerspec32
@@ -83,6 +64,5 @@
old32 = &oldts
}

- // Fall back to 32-bit timer
return timer_settime32(timerid, flags, new32, old32)
}
diff --git a/src/runtime/os_linux64.go b/src/runtime/os_linux64.go
index 7b70d80..f9571dd 100644
--- a/src/runtime/os_linux64.go
+++ b/src/runtime/os_linux64.go
@@ -10,6 +10,8 @@
"unsafe"
)

+func configure64bitsTimeOn32BitsArchitectures() {}
+
//go:noescape
func futex(addr unsafe.Pointer, op int32, val uint32, ts *timespec, addr2 unsafe.Pointer, val3 uint32) int32

Change information

Files:
  • M src/internal/runtime/syscall/linux/defs_linux_386.go
  • M src/internal/runtime/syscall/linux/defs_linux_amd64.go
  • M src/internal/runtime/syscall/linux/defs_linux_arm.go
  • M src/internal/runtime/syscall/linux/defs_linux_arm64.go
  • M src/internal/runtime/syscall/linux/defs_linux_loong64.go
  • M src/internal/runtime/syscall/linux/defs_linux_mips64x.go
  • M src/internal/runtime/syscall/linux/defs_linux_mipsx.go
  • M src/internal/runtime/syscall/linux/defs_linux_ppc64x.go
  • M src/internal/runtime/syscall/linux/defs_linux_riscv64.go
  • M src/internal/runtime/syscall/linux/defs_linux_s390x.go
  • M src/runtime/os_linux.go
  • M src/runtime/os_linux32.go
  • M src/runtime/os_linux64.go
Change size: M
Delta: 13 files changed, 76 insertions(+), 29 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
Gerrit-Change-Number: 751340
Gerrit-PatchSet: 1
Gerrit-Owner: Jorropo <jorro...@gmail.com>
Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Jorropo (Gerrit)

unread,
Mar 4, 2026, 3:44:08 AMMar 4
to goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com

Jorropo voted and added 1 comment

Votes added by Jorropo

Auto-Submit+0

1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Jorropo . resolved

CTRL + R accident, I didn't even ran this code.
We want to test this a bit before submitting it.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
Gerrit-Change-Number: 751340
Gerrit-PatchSet: 1
Gerrit-Owner: Jorropo <jorro...@gmail.com>
Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
Gerrit-Comment-Date: Wed, 04 Mar 2026 08:44:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Jorropo (Gerrit)

unread,
Mar 4, 2026, 3:51:44 AMMar 4
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Jorropo uploaded new patchset

Jorropo uploaded patch set #2 to this change.
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
Gerrit-Change-Number: 751340
Gerrit-PatchSet: 2
unsatisfied_requirement
satisfied_requirement
open
diffy

Jorropo (Gerrit)

unread,
Mar 4, 2026, 3:54:17 AMMar 4
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Jorropo

Jorropo uploaded new patchset

Jorropo uploaded patch set #3 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Jorropo
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
Gerrit-Change-Number: 751340
Gerrit-PatchSet: 3
Gerrit-Owner: Jorropo <jorro...@gmail.com>
Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
Gerrit-Attention: Jorropo <jorro...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Jake Bailey (Gerrit)

unread,
Mar 4, 2026, 4:00:39 AMMar 4
to Jorropo, goph...@pubsubhelper.golang.org, Austin Clements, Michael Knyszek, Michael Pratt, Gopher Robot, Go LUCI, golang-co...@googlegroups.com
Attention needed from Austin Clements, Jorropo, Michael Knyszek and Michael Pratt

Jake Bailey added 1 comment

File src/runtime/os_linux.go
Line 958, Patchset 3 (Latest):func getKernelVersion() kernelVersion {
Jake Bailey . unresolved

Doesn't this exist as unix.KernelVersion?

Open in Gerrit

Related details

Attention is currently required from:
  • Austin Clements
  • Jorropo
  • Michael Knyszek
  • Michael Pratt
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
    Gerrit-Change-Number: 751340
    Gerrit-PatchSet: 3
    Gerrit-Owner: Jorropo <jorro...@gmail.com>
    Gerrit-Reviewer: Austin Clements <aus...@google.com>
    Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
    Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
    Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
    Gerrit-Attention: Jorropo <jorro...@gmail.com>
    Gerrit-Attention: Michael Pratt <mpr...@google.com>
    Gerrit-Attention: Austin Clements <aus...@google.com>
    Gerrit-Attention: Michael Knyszek <mkny...@google.com>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 09:00:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Jorropo (Gerrit)

    unread,
    Mar 4, 2026, 4:17:53 AMMar 4
    to goph...@pubsubhelper.golang.org, Go LUCI, Jake Bailey, Austin Clements, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Austin Clements, Jake Bailey, Michael Knyszek and Michael Pratt

    Jorropo added 1 comment

    File src/runtime/os_linux.go
    Line 958, Patchset 3 (Latest):func getKernelVersion() kernelVersion {
    Jake Bailey . resolved

    Doesn't this exist as unix.KernelVersion?

    Jorropo

    I don't think I can call unix from runtime due to import cycles.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Clements
    • Jake Bailey
    • Michael Knyszek
    • Michael Pratt
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
      Gerrit-Change-Number: 751340
      Gerrit-PatchSet: 3
      Gerrit-Owner: Jorropo <jorro...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
      Gerrit-Attention: Jake Bailey <jacob.b...@gmail.com>
      Gerrit-Attention: Michael Pratt <mpr...@google.com>
      Gerrit-Attention: Austin Clements <aus...@google.com>
      Gerrit-Attention: Michael Knyszek <mkny...@google.com>
      Gerrit-Comment-Date: Wed, 04 Mar 2026 09:17:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Jake Bailey <jacob.b...@gmail.com>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Jorropo (Gerrit)

      unread,
      Mar 4, 2026, 4:18:16 AMMar 4
      to goph...@pubsubhelper.golang.org, Go LUCI, Jake Bailey, Austin Clements, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Austin Clements, Jake Bailey, Michael Knyszek and Michael Pratt

      Jorropo voted Commit-Queue+1

      Commit-Queue+1
      Gerrit-Comment-Date: Wed, 04 Mar 2026 09:18:08 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Jorropo (Gerrit)

      unread,
      Mar 4, 2026, 4:21:31 AMMar 4
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Austin Clements, Jake Bailey, Jorropo, Michael Knyszek and Michael Pratt

      Jorropo uploaded new patchset

      Jorropo uploaded patch set #4 to this change.
      Following approvals got outdated and were removed:
      • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Austin Clements
      • Jake Bailey
      • Jorropo
      • Michael Knyszek
      • Michael Pratt
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
      Gerrit-Change-Number: 751340
      Gerrit-PatchSet: 4
      Gerrit-Owner: Jorropo <jorro...@gmail.com>
      Gerrit-Reviewer: Austin Clements <aus...@google.com>
      Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
      Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
      Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
      Gerrit-Attention: Jake Bailey <jacob.b...@gmail.com>
      Gerrit-Attention: Jorropo <jorro...@gmail.com>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Jorropo (Gerrit)

      unread,
      Mar 4, 2026, 4:28:53 AMMar 4
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Austin Clements, Jake Bailey, Jorropo, Michael Knyszek and Michael Pratt

      Jorropo uploaded new patchset

      Jorropo uploaded patch set #5 to this change.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Austin Clements
      • Jake Bailey
      • Jorropo
      • Michael Knyszek
      • Michael Pratt
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
      Gerrit-Change-Number: 751340
      Gerrit-PatchSet: 5
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Jorropo (Gerrit)

      unread,
      Mar 4, 2026, 6:40:31 AMMar 4
      to goph...@pubsubhelper.golang.org, Go LUCI, Jake Bailey, Austin Clements, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Austin Clements, Jake Bailey, Michael Knyszek and Michael Pratt

      Jorropo added 1 comment

      Patchset-level comments
      File-level comment, Patchset 6 (Latest):
      Jorropo . resolved

      One of the two reporters tested the patch and it looks functional:
      https://github.com/golang/go/issues/77930#issuecomment-3996903970

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Austin Clements
      • Jake Bailey
      • Michael Knyszek
      • Michael Pratt
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
        Gerrit-Change-Number: 751340
        Gerrit-PatchSet: 6
        Gerrit-Owner: Jorropo <jorro...@gmail.com>
        Gerrit-Reviewer: Austin Clements <aus...@google.com>
        Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
        Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
        Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
        Gerrit-Attention: Jake Bailey <jacob.b...@gmail.com>
        Gerrit-Attention: Michael Pratt <mpr...@google.com>
        Gerrit-Attention: Austin Clements <aus...@google.com>
        Gerrit-Attention: Michael Knyszek <mkny...@google.com>
        Gerrit-Comment-Date: Wed, 04 Mar 2026 11:40:22 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Michael Pratt (Gerrit)

        unread,
        Mar 4, 2026, 11:29:32 AMMar 4
        to Jorropo, goph...@pubsubhelper.golang.org, Go LUCI, Jake Bailey, Austin Clements, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Austin Clements, Jake Bailey, Jorropo and Michael Knyszek

        Michael Pratt added 5 comments

        File src/runtime/os_linux.go
        Line 941, Patchset 6 (Latest): Sysname [65]int8
        Michael Pratt . unresolved

        No need to repeat the obnoxious API from package syscall, right? i.e., just make these `[65]byte`.

        Line 960, Patchset 6 (Latest): if _, _, err := linux.Syscall6(linux.SYS_UNAME, uintptr(unsafe.Pointer(&uname)), 0, 0, 0, 0, 0); err != 0 {
        Michael Pratt . unresolved

        Since you're already using the linux package, you may as well add a wrapper to internal/runtime/syscall/linux/syscall_linux.go.

        Line 968, Patchset 6 (Latest): for _, c := range uname.Release {
        Michael Pratt . unresolved

        I don't feel too strongly, but I have a minor preference for using the parsing code from CL 246200 (parseRelease), since it has a few years of use.

        File src/runtime/os_linux32.go
        Line 31, Patchset 6 (Latest): // TODO: Check Android version and do not skip futex_time64

        // on Android 11 or higher (API level 30+).
        Michael Pratt . unresolved

        Done? I think we're safe to assume that Android 10 won't be running Linux 5.1+?

        Line 34, Patchset 6 (Latest): return futex_time64(addr, op, val, ts, addr2, val3)
        Michael Pratt . unresolved

        Isn't this syscall also behind a kernel CONFIG option? Do we still need to test for ENOSYS?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Austin Clements
        • Jake Bailey
        • Jorropo
        • Michael Knyszek
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
          Gerrit-Change-Number: 751340
          Gerrit-PatchSet: 6
          Gerrit-Owner: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Austin Clements <aus...@google.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Jorropo <jorro...@gmail.com>
          Gerrit-Attention: Austin Clements <aus...@google.com>
          Gerrit-Attention: Michael Knyszek <mkny...@google.com>
          Gerrit-Comment-Date: Wed, 04 Mar 2026 16:29:29 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Jorropo (Gerrit)

          unread,
          Mar 4, 2026, 11:41:19 AMMar 4
          to goph...@pubsubhelper.golang.org, Go LUCI, Jake Bailey, Austin Clements, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Austin Clements, Jake Bailey, Michael Knyszek and Michael Pratt

          Jorropo added 4 comments

          File src/runtime/os_linux.go
          Michael Pratt . unresolved

          No need to repeat the obnoxious API from package syscall, right? i.e., just make these `[65]byte`.

          Jorropo

          True I just blindly copy pasted.

          Line 968, Patchset 6 (Latest): for _, c := range uname.Release {
          Michael Pratt . unresolved

          I don't feel too strongly, but I have a minor preference for using the parsing code from CL 246200 (parseRelease), since it has a few years of use.

          Jorropo

          Sure I'll use this.

          File src/runtime/os_linux32.go
          Line 31, Patchset 6 (Latest): // TODO: Check Android version and do not skip futex_time64
          // on Android 11 or higher (API level 30+).
          Michael Pratt . resolved

          Done? I think we're safe to assume that Android 10 won't be running Linux 5.1+?

          Jorropo

          Yeah so I've checked and I'm not sure.

          Android in their infinite wisdom support 3 kernel branches per major Android version (probably for hardware / SOCs not in upstream ¿),
          For Android 11 we have 5.4, 4.19 and 4.14.

          I am 95% confident that for Android 11 running 5.4, the 64 bits syscall works.
          I do not know what happens if you try to use the 64 bits syscall for Android >= 11 yet running Linux <5.1.

          It could give you ENOSYS (if the seccomp config is per Android version and not tuned to the underlying kernel) or it could give a seccomp violation.
          However then we will parse uname, see that it is bellow 5.1 and not use it.

          So I think it's fine

          Line 34, Patchset 6 (Latest): return futex_time64(addr, op, val, ts, addr2, val3)
          Michael Pratt . resolved

          Isn't this syscall also behind a kernel CONFIG option? Do we still need to test for ENOSYS?

          Jorropo

          It is the other way around.
          The 32 bits syscall is gated behind the KCONFIG.

          The 64 bits syscall always exists if the version is 5.1.
          The KCONFIG was also added in 5.1.

          So if <5.1 we know the 32 bits syscall always exists.
          If >=5.1 we know the 64 bits syscall always exists.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Austin Clements
          • Jake Bailey
          • Michael Knyszek
          • Michael Pratt
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
          Gerrit-Change-Number: 751340
          Gerrit-PatchSet: 6
          Gerrit-Owner: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Austin Clements <aus...@google.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Michael Pratt <mpr...@google.com>
          Gerrit-Attention: Austin Clements <aus...@google.com>
          Gerrit-Attention: Michael Knyszek <mkny...@google.com>
          Gerrit-Comment-Date: Wed, 04 Mar 2026 16:41:12 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Michael Pratt <mpr...@google.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Michael Pratt (Gerrit)

          unread,
          Mar 4, 2026, 12:56:37 PMMar 4
          to Jorropo, goph...@pubsubhelper.golang.org, Go LUCI, Jake Bailey, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Jake Bailey, Jorropo and Michael Knyszek

          Michael Pratt added 1 comment

          File src/runtime/os_linux32.go
          Line 31, Patchset 6 (Latest): // TODO: Check Android version and do not skip futex_time64
          // on Android 11 or higher (API level 30+).
          Michael Pratt . resolved

          Done? I think we're safe to assume that Android 10 won't be running Linux 5.1+?

          Jorropo

          Yeah so I've checked and I'm not sure.

          Android in their infinite wisdom support 3 kernel branches per major Android version (probably for hardware / SOCs not in upstream ¿),
          For Android 11 we have 5.4, 4.19 and 4.14.

          I am 95% confident that for Android 11 running 5.4, the 64 bits syscall works.
          I do not know what happens if you try to use the 64 bits syscall for Android >= 11 yet running Linux <5.1.

          It could give you ENOSYS (if the seccomp config is per Android version and not tuned to the underlying kernel) or it could give a seccomp violation.
          However then we will parse uname, see that it is bellow 5.1 and not use it.

          So I think it's fine

          Michael Pratt

          It could give you ENOSYS (if the seccomp config is per Android version and not tuned to the underlying kernel) or it could give a seccomp violation.

          I believe the seccomp configuration is based primarily on the Android.

          In case you haven't seen it https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/tools/genseccomp.py generates the seccomp BPF program using the various text files in https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/. I think the tl;dr is it allows `(SYSCALLS.TXT - SECCOMP_BLOCKLIST*.txt + SECCOMP_ALLOWLIST*.TXT)` (with some adjustment for app vs system, etc).

          I haven't looked closely at how it has changed between versions or quite followed which deny action is selected (return EPERM vs signal vs kill).

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jake Bailey
          • Jorropo
          • Michael Knyszek
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
          Gerrit-Change-Number: 751340
          Gerrit-PatchSet: 6
          Gerrit-Owner: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Jorropo <jorro...@gmail.com>
          Gerrit-Attention: Michael Knyszek <mkny...@google.com>
          Gerrit-Comment-Date: Wed, 04 Mar 2026 17:56:33 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Jorropo <jorro...@gmail.com>
          Comment-In-Reply-To: Michael Pratt <mpr...@google.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Jorropo (Gerrit)

          unread,
          Mar 4, 2026, 1:01:18 PMMar 4
          to goph...@pubsubhelper.golang.org, Go LUCI, Jake Bailey, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Michael Knyszek and Michael Pratt

          Jorropo added 1 comment

          File src/runtime/os_linux32.go
          Line 31, Patchset 6 (Latest): // TODO: Check Android version and do not skip futex_time64
          // on Android 11 or higher (API level 30+).
          Michael Pratt . resolved

          Done? I think we're safe to assume that Android 10 won't be running Linux 5.1+?

          Jorropo

          Yeah so I've checked and I'm not sure.

          Android in their infinite wisdom support 3 kernel branches per major Android version (probably for hardware / SOCs not in upstream ¿),
          For Android 11 we have 5.4, 4.19 and 4.14.

          I am 95% confident that for Android 11 running 5.4, the 64 bits syscall works.
          I do not know what happens if you try to use the 64 bits syscall for Android >= 11 yet running Linux <5.1.

          It could give you ENOSYS (if the seccomp config is per Android version and not tuned to the underlying kernel) or it could give a seccomp violation.
          However then we will parse uname, see that it is bellow 5.1 and not use it.

          So I think it's fine

          Michael Pratt

          It could give you ENOSYS (if the seccomp config is per Android version and not tuned to the underlying kernel) or it could give a seccomp violation.

          I believe the seccomp configuration is based primarily on the Android.

          In case you haven't seen it https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/tools/genseccomp.py generates the seccomp BPF program using the various text files in https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/. I think the tl;dr is it allows `(SYSCALLS.TXT - SECCOMP_BLOCKLIST*.txt + SECCOMP_ALLOWLIST*.TXT)` (with some adjustment for app vs system, etc).

          I haven't looked closely at how it has changed between versions or quite followed which deny action is selected (return EPERM vs signal vs kill).

          Jorropo

          To be honest unless I learn something new I don't care about looking to the Android code 😄

          Because there isn't a problem with using the 32 bits on versions of Linux (/ Android) where `CONFIG_COMPAT_32BIT_TIME` does not exists.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Michael Knyszek
          • Michael Pratt
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
          Gerrit-Change-Number: 751340
          Gerrit-PatchSet: 6
          Gerrit-Owner: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Michael Pratt <mpr...@google.com>
          Gerrit-Attention: Michael Knyszek <mkny...@google.com>
          Gerrit-Comment-Date: Wed, 04 Mar 2026 18:01:11 +0000
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Brad Fitzpatrick (Gerrit)

          unread,
          Mar 19, 2026, 1:12:14 PM (17 hours ago) Mar 19
          to Jorropo, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Go LUCI, Jake Bailey, Michael Knyszek, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Jorropo, Michael Knyszek and Michael Pratt

          Brad Fitzpatrick added 1 comment

          Patchset-level comments
          Brad Fitzpatrick . resolved

          Jorropo, are you still working on this?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jorropo
          • Michael Knyszek
          • Michael Pratt
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
          Gerrit-Change-Number: 751340
          Gerrit-PatchSet: 6
          Gerrit-Owner: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Jorropo <jorro...@gmail.com>
          Gerrit-Attention: Michael Pratt <mpr...@google.com>
          Gerrit-Attention: Michael Knyszek <mkny...@google.com>
          Gerrit-Comment-Date: Thu, 19 Mar 2026 17:12:09 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Jorropo (Gerrit)

          unread,
          Mar 19, 2026, 7:23:29 PM (11 hours ago) Mar 19
          to goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Go LUCI, Jake Bailey, Michael Pratt, Gopher Robot, golang-co...@googlegroups.com
          Attention needed from Brad Fitzpatrick

          Jorropo added 1 comment

          Patchset-level comments
          Brad Fitzpatrick . resolved

          Jorropo, are you still working on this?

          Jorropo

          I've been busy with work, if someone else implement a fixed Uname based solution I'll review and merge it.

          Otherwise I'll get back to this in a couple weeks.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Brad Fitzpatrick
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I1c9490265bdd0e05bff7ff6a3ae0ddfeb347ccc6
          Gerrit-Change-Number: 751340
          Gerrit-PatchSet: 6
          Gerrit-Owner: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Jorropo <jorro...@gmail.com>
          Gerrit-Reviewer: Michael Knyszek <mkny...@google.com>
          Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
          Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Jake Bailey <jacob.b...@gmail.com>
          Gerrit-Attention: Brad Fitzpatrick <brad...@golang.org>
          Gerrit-Comment-Date: Thu, 19 Mar 2026 23:23:21 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Brad Fitzpatrick <brad...@golang.org>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages