From owner-dev-commits-src-main@freebsd.org Thu May 6 09:33:36 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D05815F8F06; Thu, 6 May 2021 09:33:36 +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 4FbT0c5YB0z4Tg7; Thu, 6 May 2021 09:33:36 +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 B18E7161A9; Thu, 6 May 2021 09:33:36 +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 1469Xa2N040983; Thu, 6 May 2021 09:33:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1469XaJI040982; Thu, 6 May 2021 09:33:36 GMT (envelope-from git) Date: Thu, 6 May 2021 09:33:36 GMT Message-Id: <202105060933.1469XaJI040982@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: 916f3dba4523 - main - linux(4): make arch_prctl(2) support GET_CET_STATUS, report unknown codes 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: 916f3dba4523d1b2d478538875d45df56b20bcdb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 09:33:36 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=916f3dba4523d1b2d478538875d45df56b20bcdb commit 916f3dba4523d1b2d478538875d45df56b20bcdb Author: Edward Tomasz Napierala AuthorDate: 2021-05-06 08:33:35 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-05-06 08:33:42 +0000 linux(4): make arch_prctl(2) support GET_CET_STATUS, report unknown codes This is largely a no-op, to make future debugging slightly easier. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30035 --- sys/amd64/linux/linux.h | 1 + sys/amd64/linux/linux_machdep.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index cf9f5cccb287..dc4986817d11 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -431,6 +431,7 @@ struct l_pollfd { #define LINUX_ARCH_SET_FS 0x1002 #define LINUX_ARCH_GET_FS 0x1003 #define LINUX_ARCH_GET_GS 0x1004 +#define LINUX_ARCH_CET_STATUS 0x3001 #define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index a82ab411daa1..d2f9d0cacd3c 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -242,6 +242,7 @@ linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap) int linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) { + unsigned long long cet[3]; struct pcb *pcb; int error; @@ -275,7 +276,12 @@ linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) error = copyout(&pcb->pcb_gsbase, PTRIN(args->addr), sizeof(args->addr)); break; + case LINUX_ARCH_CET_STATUS: + memset(cet, 0, sizeof(cet)); + error = copyout(&cet, PTRIN(args->addr), sizeof(cet)); + break; default: + linux_msg(td, "unsupported arch_prctl code %#x", args->code); error = EINVAL; } return (error);