Repository navigation
Tags
Tags
unix: avoid using stale written count from sendfile on freebsd/386 af… …ter EINVAL On the freebsd-386 builder, the written-byte count returned by the sendfile(2) system call was observed to be modified even when the call returns EINVAL. The man page only guarantees the value is written on success, EINTR, or EAGAIN, so only use it in those cases. Port the fix made to syscall.sendfile in package syscall by CL 635815. Updates golang/go#70763 Change-Id: I4762e1c23d98082634a74401c53cdc699b390ef8 Reviewed-on: https://go-review.googlesource.com/c/sys/+/860562 Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
unix/linux: unify ppc64x syscall wrappers CL 146518 (commit 7155702) attempted to fix a linker limitation by using native go. This resulted in some very hard to uncover issues noted in golang/go#81981. Reintroduce the asm, but use an indirect jump to avoid linker generated trampolines. Fixes golang/go#81981 Change-Id: If13d401712dc0294d66611546f879eebfdae59af Reviewed-on: https://go-review.googlesource.com/c/sys/+/845125 Reviewed-by: Ian Lance Taylor <iant@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
cpu: add riscv64 hwprobe drift test Add a test that checks the Linux/riscv64 riscv_hwprobe constants, syscall number, and pair layout copied into x/sys/cpu stay in sync with the generated x/sys/unix sources. The cpu package cannot depend on unix in production, but test files can import it. Compare the copied definitions directly with unix rather than parsing source files. Updates golang/go#61416 Co-authored-by: YuanSheng <yuansheng@isrc.iscas.ac.cn> Change-Id: I01407445099424b429d2494b63c05ef1bba746ef Reviewed-on: https://go-review.googlesource.com/c/sys/+/800020 Auto-Submit: Keith Randall <khr@golang.org> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Keith Randall <khr@golang.org>
cpu: handle vendor suffixes in parseRelease Kernel release strings such as "3.4.35_hi3535" on some Synology devices failed to parse because only dash and plus suffixes were stripped. Parse the leading digits of each component instead, mirroring the Go runtime fix. This copies the implementation from the Go runtime's parseRelease as updated in CL 781800. Fixes golang/go#80094 Co-authored-by: Brad Fitzpatrick <bradfitz@golang.org> Change-Id: I41f8fd0a1d6c012eebd5368e623b42e99220d1a3 Reviewed-on: https://go-review.googlesource.com/c/sys/+/793760 Reviewed-by: Jorropo <jorropo.pgm@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Junyang Shao <shaojunyang@google.com>
unix: add GPIO constants and structs This adds everything needed to use Linux's GPIO V2 UAPI, including the ioctls, structs and constants. As on some architectures char is signed by default and the UAPI doesn't make it unsigned explicitly a mkpost fixup is used to make the types more usable (by things like unix.ByteSliceToString). Change-Id: Icdb0ca4a225316ca5e948e21ab21789636297a57 Reviewed-on: https://go-review.googlesource.com/c/sys/+/752623 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
unix: update to Linux kernel 7.0 Change-Id: I2e77f6fa2ac141018c4fe5cba2c8615c9e05d99c GitHub-Last-Rev: 5d46d8f GitHub-Pull-Request: #274 Reviewed-on: https://go-review.googlesource.com/c/sys/+/779140 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
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>
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>
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>
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>
PreviousNext