git: d056fef82aef - stable/13 - linux(4): Make ptrace_pokeusr machine dependent
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Jun 2023 08:20:36 UTC
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d056fef82aefb703441a33af719db9182ab566bc commit d056fef82aefb703441a33af719db9182ab566bc Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-05-18 17:01:12 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-06-29 08:15:59 +0000 linux(4): Make ptrace_pokeusr machine dependent Differential Revision: https://reviews.freebsd.org/D40096 MFC after: 1 week (cherry picked from commit 3d0addcd35193461e927db6cfe4b6d9b579eed6b) --- sys/amd64/linux/linux.h | 2 ++ sys/amd64/linux/linux_machdep.c | 8 ++++++++ sys/amd64/linux32/linux.h | 2 ++ sys/amd64/linux32/linux32_machdep.c | 9 +++++++++ sys/arm64/linux/linux.h | 2 ++ sys/arm64/linux/linux_machdep.c | 9 +++++++++ sys/compat/linux/linux_ptrace.c | 8 -------- 7 files changed, 32 insertions(+), 8 deletions(-) diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index 57f1ee0115e6..a2fb6c94466e 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -324,6 +324,8 @@ int linux_ptrace_getregs_machdep(struct thread *td, pid_t pid, struct linux_pt_regset *l_regset); int linux_ptrace_peekuser(struct thread *td, pid_t pid, void *addr, void *data); +int linux_ptrace_pokeuser(struct thread *td, pid_t pid, + void *addr, void *data); #endif /* _KERNEL */ #endif /* !_AMD64_LINUX_H_ */ diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index 233d66a40899..ddb291169a03 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -397,4 +397,12 @@ linux_ptrace_peekuser(struct thread *td, pid_t pid, void *addr, void *data) return (copyout(&val, data, sizeof(val))); } +int +linux_ptrace_pokeuser(struct thread *td, pid_t pid, void *addr, void *data) +{ + + LINUX_RATELIMIT_MSG_OPT1("PTRACE_POKEUSER offset %ld " + "not implemented; returning EINVAL", (uintptr_t)addr); + return (EINVAL); +} #undef LINUX_URO diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h index a98777adeaf5..0553fe2cae45 100644 --- a/sys/amd64/linux32/linux.h +++ b/sys/amd64/linux32/linux.h @@ -467,6 +467,8 @@ void bsd_to_linux_regset32(const struct reg32 *b_reg, struct linux_pt_regset32 *l_regset); int linux_ptrace_peekuser(struct thread *td, pid_t pid, void *addr, void *data); +int linux_ptrace_pokeuser(struct thread *td, pid_t pid, + void *addr, void *data); extern bool linux32_emulate_i386; #endif /* _KERNEL */ diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index afc60fb7e822..23d8f8767282 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -751,3 +751,12 @@ linux_ptrace_peekuser(struct thread *td, pid_t pid, void *addr, void *data) "returning EINVAL", (uintptr_t)addr); return (EINVAL); } + +int +linux_ptrace_pokeuser(struct thread *td, pid_t pid, void *addr, void *data) +{ + + LINUX_RATELIMIT_MSG_OPT1("PTRACE_POKEUSER offset %ld " + "not implemented; returning EINVAL", (uintptr_t)addr); + return (EINVAL); +} diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index be6733c81d97..700a97045dd1 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -240,6 +240,8 @@ int linux_ptrace_getregs_machdep(struct thread *td, pid_t pid, struct linux_pt_regset *l_regset); int linux_ptrace_peekuser(struct thread *td, pid_t pid, void *addr, void *data); +int linux_ptrace_pokeuser(struct thread *td, pid_t pid, + void *addr, void *data); #endif /* _KERNEL */ #endif /* _ARM64_LINUX_H_ */ diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index 2e472869eedb..87014950497e 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -160,3 +160,12 @@ linux_ptrace_peekuser(struct thread *td, pid_t pid, void *addr, void *data) "returning EINVAL", (uintptr_t)addr); return (EINVAL); } + +int +linux_ptrace_pokeuser(struct thread *td, pid_t pid, void *addr, void *data) +{ + + LINUX_RATELIMIT_MSG_OPT1("PTRACE_POKEUSER offset %ld " + "not implemented; returning EINVAL", (uintptr_t)addr); + return (EINVAL); +} diff --git a/sys/compat/linux/linux_ptrace.c b/sys/compat/linux/linux_ptrace.c index c1c7abf70a9d..5b971bbfb497 100644 --- a/sys/compat/linux/linux_ptrace.c +++ b/sys/compat/linux/linux_ptrace.c @@ -174,14 +174,6 @@ linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) return (error); } -static int -linux_ptrace_pokeuser(struct thread *td, pid_t pid, void *addr, void *data) -{ - - linux_msg(td, "PTRACE_POKEUSER not implemented; returning EINVAL"); - return (EINVAL); -} - static int linux_ptrace_setoptions(struct thread *td, pid_t pid, l_ulong data) {