From nobody Sat Nov 6 08:28:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 25AEA183E0BD; Sat, 6 Nov 2021 08:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HmVrL6lRxz3n9f; Sat, 6 Nov 2021 08:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B907027DC5; Sat, 6 Nov 2021 08:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A68SIIe058502; Sat, 6 Nov 2021 08:28:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A68SIDs058501; Sat, 6 Nov 2021 08:28:18 GMT (envelope-from git) Date: Sat, 6 Nov 2021 08:28:18 GMT Message-Id: <202111060828.1A68SIDs058501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 3be6e606d787 - main - linux: Fix another amd64-specific piece of linux_ptrace.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3be6e606d7870a79baa7a4c5947dffd333defa79 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=3be6e606d7870a79baa7a4c5947dffd333defa79 commit 3be6e606d7870a79baa7a4c5947dffd333defa79 Author: Edward Tomasz Napierala AuthorDate: 2021-11-06 07:56:51 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-11-06 08:28:11 +0000 linux: Fix another amd64-specific piece of linux_ptrace.c This was missed in c91d0e59be1. No functional changes. Sponsored By: EPSRC --- sys/amd64/linux/linux_ptrace.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 2ebf1c2be997..5910e4ec3d4f 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -41,8 +41,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include #include #include #include @@ -343,10 +343,10 @@ linux_ptrace_getsiginfo(struct thread *td, pid_t pid, l_ulong data) static int linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) { - struct ptrace_lwpinfo lwpinfo; struct reg b_reg; struct linux_pt_regset l_regset; #ifdef __amd64__ + struct ptrace_lwpinfo lwpinfo; struct pcb *pcb; #endif int error; @@ -364,7 +364,6 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) l_regset.fs_base = pcb->pcb_fsbase; l_regset.gs_base = pcb->pcb_gsbase; -#endif error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { @@ -385,6 +384,7 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) */ l_regset.orig_rax = lwpinfo.pl_syscall_code; } +#endif error = copyout(&l_regset, (void *)data, sizeof(l_regset)); return (error); @@ -408,11 +408,11 @@ linux_ptrace_setregs(struct thread *td, pid_t pid, void *data) static int linux_ptrace_getregset_prstatus(struct thread *td, pid_t pid, l_ulong data) { - struct ptrace_lwpinfo lwpinfo; struct reg b_reg; struct linux_pt_regset l_regset; struct iovec iov; #ifdef __amd64__ + struct ptrace_lwpinfo lwpinfo; struct pcb *pcb; #endif size_t len; @@ -437,7 +437,6 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid_t pid, l_ulong data) l_regset.fs_base = pcb->pcb_fsbase; l_regset.gs_base = pcb->pcb_gsbase; -#endif error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { @@ -459,6 +458,7 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid_t pid, l_ulong data) */ l_regset.orig_rax = lwpinfo.pl_syscall_code; } +#endif len = MIN(iov.iov_len, sizeof(l_regset)); error = copyout(&l_regset, (void *)iov.iov_base, len);