From nobody Mon Feb 21 13:48:56 2022 X-Original-To: dev-commits-src-branches@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 764561839FC4; Mon, 21 Feb 2022 13:48:58 +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 4K2Ntx4vSkz3Pnb; Mon, 21 Feb 2022 13:48:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645451337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q69iEjrJfweZDiH/aztEmtyfXWBMHQ1DDHtYN0SdZWU=; b=e5UQ/sXQ+Rrq0XTuGfR8RrxtZltbOMiviYDNOW+MTyFPLaY6fpR3nfqeeOjgDn2xK1bRI6 6B8zVLLj5DGrihNnRourkcHqLYhMAV50/HT5tg6pZ++x6mCpiq4HGdeU1uk7IXbHqz5O1m UZ2Iveq97k4NEyVHmK6+ubl6/vbpB+pkNGLt7GirJzDNRqP5FBnA42G9zezeZuZiZqo3pm 6mbjePC5U6igZqm967AMM6CNKDRiR0UuuLWPVafyMN5AIUu9GQ2OKJrEt7b/opwO0ioI65 9gkkE3oaRENBSfa8FcfuZmLOiLmxizvGiVG1sjs6y1daEy0NFfmvGieaEGB1QQ== 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 98A6A1162B; Mon, 21 Feb 2022 13:48:56 +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 21LDmugP091947; Mon, 21 Feb 2022 13:48:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21LDmuTI091946; Mon, 21 Feb 2022 13:48:56 GMT (envelope-from git) Date: Mon, 21 Feb 2022 13:48:56 GMT Message-Id: <202202211348.21LDmuTI091946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 98e26c32bb74 - stable/13 - linux: Improve debugging for PTRACE_GETREGSET List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 98e26c32bb741d77749ead85ada42ae5920d66a4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645451337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q69iEjrJfweZDiH/aztEmtyfXWBMHQ1DDHtYN0SdZWU=; b=Jm6bwEZUwJ2DuMf3TUqz62Pd4lZk1bNKAWai5obwc/VWXTLs8BGEckR+J4KWlWBdGTJmcS Bp/aAHhg435mmmEHUnJ22maGOeSGG5EPu/2rrJjObu18No6w6+VuhjHy9mqGxpGaPAYnMS 3AU2vXwU6J3lJ+wVyvhhrSKS/hC2qyeeOg6bUsbIjBbu2OLjMjDbbRpPSg1Rmqf9xYL0TB MssnyiyLnEGDh0EJe2Kn0XNInADeb4oIewgRvTyCTG81AIsKQcJfQCLOd18GE9Be9ixiZ+ kUW6yCb5eNQzEarl0fO7r8HV09/1SBxPVX+S48FPUduh2MnZ3/j5quAgJ3bVeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645451337; a=rsa-sha256; cv=none; b=EBM8KgCK4ywCdVHh070XIImS3Yroz9nXtzLE/4ls5oDjp6pa7wd3Lxd89UeNKYPCg9uR2P /t1UibY5wOtp+lNz41mvNPSykjXOKGvA5EUIt8RvPqbPpQ53sttLmokQzzIdkafLUeL0wa aEbxhBj3vYeCgQy3YfFkjhLQEnaGdOXyDdchi1SH4c7nbP9JujQAjl814OHz3U8le0/jE7 VPX+QwSMHa/u+Ur4rQLNK3DtAsa7yWwO4Wjy1Bp8rI1z66RZHgBHIhasQx7Sywc8ZcI8mv nWYp+qDp49n0+RYRnpYWLfAoOAbdnEo+rn+XSqXOnKx7gS7TzWUvuBpfw4V2gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=98e26c32bb741d77749ead85ada42ae5920d66a4 commit 98e26c32bb741d77749ead85ada42ae5920d66a4 Author: Edward Tomasz Napierala AuthorDate: 2021-10-17 11:52:39 +0000 Commit: Edward Tomasz Napierala CommitDate: 2022-02-21 13:35:10 +0000 linux: Improve debugging for PTRACE_GETREGSET It's triggered by gdb(1). Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32456 (cherry picked from commit a03d4d73e4c7c73447263294df6ebd1791ab01f2) --- sys/amd64/linux/linux_ptrace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 5f1e0eb93f5a..0917b175aa98 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -85,7 +85,8 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_O_EXITKILL 1048576 #define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 -#define LINUX_NT_PRSTATUS 1 +#define LINUX_NT_PRSTATUS 0x1 +#define LINUX_NT_X86_XSTATE 0x202 #define LINUX_PTRACE_O_MASK (LINUX_PTRACE_O_TRACESYSGOOD | \ LINUX_PTRACE_O_TRACEFORK | LINUX_PTRACE_O_TRACEVFORK | \ @@ -574,8 +575,12 @@ linux_ptrace_getregset(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) switch (addr) { case LINUX_NT_PRSTATUS: return (linux_ptrace_getregset_prstatus(td, pid, data)); + case LINUX_NT_X86_XSTATE: + linux_msg(td, "PTRAGE_GETREGSET NT_X86_XSTATE not implemented; " + "returning EINVAL"); + return (EINVAL); default: - linux_msg(td, "PTRACE_GETREGSET request %ld not implemented; " + linux_msg(td, "PTRACE_GETREGSET request %#lx not implemented; " "returning EINVAL", addr); return (EINVAL); }