Skip to content

Tags: golang/sys

Tags

v0.44.0

Toggle v0.44.0's commit message
windows: avoid uint16 overflow in NewNTUnicodeString

Fixes CVE-2026-39824
Fixes #78916

Change-Id: I344518a17d59fd81c4bb39da0b3e13be6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/sys/+/770080
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>

v0.43.0

Toggle v0.43.0's commit message
windows: support nil security descriptor on GetNamedSecurityInfo

GetNamedSecurityInfoW may return a nil security descriptor when the
object exists but has no security descriptor. This change allows
GetNamedSecurityInfo to return a nil *SECURITY_DESCRIPTOR in that case,
instead of crashing when trying to copy the nil security descriptor.

Fixes golang/go#78396

Change-Id: I2f8d26a431e0a5c3de535cf8983db1465acc24fe
Reviewed-on: https://go-review.googlesource.com/c/sys/+/760160
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>

v0.42.0

Toggle v0.42.0's commit message
windows/registry: correct KeyInfo.ModTime calculation

Filetime.Nanoseconds() has a major drawback: the returned int64 is too small to
represent Filetime's zero value (January 1, 1601, [1]) in terms of nanoseconds
since Epoch (00:00:00 UTC, January 1, 1970); MinInt64 [2] only dates back to
year 1677.

This has real-life implications, e.g., some Windows sub systems (Perflib, to
    name one) create registry keys with the last write time property set to
zero (see note below). In this case, ModTime() reports an underflow-affected
value of 2185-07-22T00:34:33.709551+01:00.

This commit drops usage of Nanoseconds() in favor of a conversion that converts
first to seconds and nanoseconds before gauging thus is capable to cover the
full range of Filetime values.

A note on last write time values: `lastWriteTime` is not exposed in the UI
(say, `regedit`) or in PowerShell (`Get-ItemProperty`), you need to query
`RegQueryInfoKeyA` [3] explicitly in some way [4] or another [5]. The source of
the latter is offline by now but can be found elsewhere [6] and provides a
quick way to show the value.

[1] https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime
[2] https://pkg.go.dev/math#pkg-constants
[3] https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryinfokeya?redirectedfrom=MSDN
[4] https://learn.microsoft.com/en-us/windows/win32/sysinfo/retrieving-the-last-write-time
[5] https://learn-powershell.net/2014/12/18/retrieving-a-registry-key-lastwritetime-using-powershell/
[6] https://github.com/wxrdnx/GetRegistryKeyLastWriteTimeAndClassName

Fixes golang/go#74335.

Change-Id: I83dc1d6b5e0c581bfb53d58ee08a21ed9c166b0f
GitHub-Last-Rev: 0073d1d
GitHub-Pull-Request: #251
Reviewed-on: https://go-review.googlesource.com/c/sys/+/682816
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: David Chase <drchase@google.com>

v0.41.0

Toggle v0.41.0's commit message
cpu: use IsProcessorFeaturePresent to calculate ARM64 on windows

For golang/go#76791

Change-Id: I9500b38b17b5e3e141df8770d82c725c2ba8fd65
Cq-Include-Trybots: luci.golang.try:x_sys-gotip-windows-arm64
Reviewed-on: https://go-review.googlesource.com/c/sys/+/740880
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>

v0.40.0

Toggle v0.40.0's commit message
sys/cpu: add symbolic constants for remaining cpuid bits

Change-Id: Ia6afa8f69598fc929c1ea21465e656b5a95e656e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/731322
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>

v0.39.0

Toggle v0.39.0's commit message
unix: fix out of bounds memory access in tests

sockaddrIUCVToAny used the wrong size to for copying to RawSockaddrAny.
We found this by running the test with ASAN.

Change-Id: I2a2ec28f9bd55aeba4ddcb4243ad61ec010087df
Reviewed-on: https://go-review.googlesource.com/c/sys/+/724280
Reviewed-by: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

v0.38.0

Toggle v0.38.0's commit message
cpu: also use MRS instruction in getmmfr1

Use the MRS instruction with the corresponding system register instead
of encoding the instructions using a WORD directive. This was missed in
CL 583135.

Change-Id: Ifcbbd81baa903f1da442eae2e49c06284db9c37d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/717681
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

v0.37.0

Toggle v0.37.0's commit message
unix: mkall.sh: fail if docker build failed

When docker build fails, docker run (in my case podman) tries to find
the generate:linux image from various mirrors, which is very confusing.
We should error out if docker build fails.

Change-Id: I4fd78e9fa339e03029b1bf003b3239ca23a7ed1b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/706916
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Kirill Kolyshkin <kolyshkin@gmail.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Carlos Amedee <carlos@golang.org>

v0.36.0

Toggle v0.36.0's commit message
windows: add FILE_ZERO_DATA_INFORMATION

This is needed for invoking windows.DeviceIoControl with
windows.FSCTL_SET_ZERO_DATA.

Change-Id: I20f93a40a86b92e6bdeeec096ffc0245e8184672
GitHub-Last-Rev: 01d299a
GitHub-Pull-Request: #261
Reviewed-on: https://go-review.googlesource.com/c/sys/+/698436
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>

v0.35.0

Toggle v0.35.0's commit message
unix/linux: update to Linux kernel 6.16, Go to 1.24.5

Change-Id: Id0b60b5bbc33c48e49ba655babf0856878960e29
Reviewed-on: https://go-review.googlesource.com/c/sys/+/693215
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>