aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/zsyscall_linux_arm.go
diff options
context:
space:
mode:
authorDmitri Goutnik <dgoutnik@gmail.com>2023-02-22 10:58:14 -0500
committerGopher Robot <gobot@golang.org>2023-02-23 11:28:51 +0000
commit4c5d6edeb2b10c2044d1ea2b4fa3e403133431c8 (patch)
treef3dc2e918e672753257a3b98da2e7d95d23df74a /src/syscall/zsyscall_linux_arm.go
parent6af9635fb8a002f563a1765f7ab2bd97d4e4d4df (diff)
downloadgo-4c5d6edeb2b10c2044d1ea2b4fa3e403133431c8.tar.xz
syscall: add ptracePtr that accepts pointer arg as unsafe.Pointer
The existing ptrace wrapper accepts pointer argument as an uintptr which often points to the memory allocated in Go. This violates unsafe.Pointer safety rules. Fixes #58387 Change-Id: Iab12122c495953f94ea00c2a61654a818a464205 Reviewed-on: https://go-review.googlesource.com/c/go/+/470299 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Dmitri Goutnik <dgoutnik@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Dmitri Goutnik <dgoutnik@gmail.com>
Diffstat (limited to 'src/syscall/zsyscall_linux_arm.go')
-rw-r--r--src/syscall/zsyscall_linux_arm.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/syscall/zsyscall_linux_arm.go b/src/syscall/zsyscall_linux_arm.go
index 69f811a0ec..86d8e1c2d7 100644
--- a/src/syscall/zsyscall_linux_arm.go
+++ b/src/syscall/zsyscall_linux_arm.go
@@ -210,6 +210,16 @@ func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func ptracePtr(request int, pid int, addr uintptr, data unsafe.Pointer) (err error) {
+ _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(arg)