From patchwork Fri Aug 6 22:45:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 1514529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GhLDb4zl4z9s5R for ; Sat, 7 Aug 2021 08:46:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DDB1639ADC27 for ; Fri, 6 Aug 2021 22:46:04 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 457AC3853802 for ; Fri, 6 Aug 2021 22:45:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 457AC3853802 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: avK8EQQSf0ID/80sPoWVIG6DZLJPdPXRMHfG8jQ1+6EvoZgpL9wvFgH4uvUZEe742PBoCBerZQ WP3jLBBBNZa7WehWbvuAW1eDXJkAfhAzfhiW+nvdmG7+34kUP0iB620ATuCKlgqp8lenx50o29 8NR66vaMxpycWw9so/cHXUOXr2aoCHewaHE+01irgpj/O3iiRXbECm2Me9U/r+H7h7b4jw9blx QoIpMubTtWqdnzjNJGAoBWstx/kocblAjDvZT4xzovkQGsEtCaRKm5hG6leHj2l/ouQbBBviKt 0YyVKo/wcKSyqzRKdgdSUzCm X-IronPort-AV: E=Sophos;i="5.84,301,1620720000"; d="scan'208";a="66860117" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 06 Aug 2021 14:45:55 -0800 IronPort-SDR: 7XXiwMhO2UIseYRW1AIeAhSgSVrM2FrHayb/uYwSYmcX5fe71S/xxkGuXOCcOJcugmQ4iTMLCg g6KwnSZuUDerqG9NtsuTUqFRTBw3Ku0gljNYeMfr9ufTsSdJ+NgOTe4qfjLBm8bbbfKRxKez2v JGPszpqMIGxXL3xj4HbLjrFpbq93QB5zt/qZnVWB39KwGI7AZg/bo45q4l1WlxE6Wec1MCnV3z vXxAoynEb4AM//BjMbj6DGlYn/JR0D7mPMonqfaieQuq03sdfR0nE0GtQlgX0fgMj+qaJ6PKup Tf8= Date: Fri, 6 Aug 2021 22:45:47 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Subject: Add PTRACE_GET_RSEQ_CONFIGURATION from Linux 5.13 to sys/ptrace.h Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-05.mgc.mentorg.com (139.181.222.5) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3125.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" Linux 5.13 adds a PTRACE_GET_RSEQ_CONFIGURATION constant, with an associated ptrace_rseq_configuration structure. Add this constant to the various sys/ptrace.h headers in glibc, with the structure in bits/ptrace-shared.h (named struct __ptrace_rseq_configuration in glibc, as with other such structures). Tested for x86_64, and with build-many-glibcs.py. diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h index af8193cbe7..1fae1dce9c 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h @@ -58,6 +58,7 @@ __BEGIN_DECLS #undef PTRACE_SECCOMP_GET_FILTER #undef PTRACE_SECCOMP_GET_METADATA #undef PTRACE_GET_SYSCALL_INFO +#undef PTRACE_GET_RSEQ_CONFIGURATION /* Type of the REQUEST argument to `ptrace.' */ enum __ptrace_request @@ -190,8 +191,12 @@ enum __ptrace_request #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA /* Get information about system call. */ - PTRACE_GET_SYSCALL_INFO = 0x420e + PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION }; diff --git a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h index cdb1f159a7..2e38436648 100644 --- a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h @@ -200,8 +200,12 @@ enum __ptrace_request #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA /* Get information about system call. */ - PTRACE_GET_SYSCALL_INFO = 0x420e + PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION }; diff --git a/sysdeps/unix/sysv/linux/bits/ptrace-shared.h b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h index 7d40634da5..7e95ca7082 100644 --- a/sysdeps/unix/sysv/linux/bits/ptrace-shared.h +++ b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h @@ -120,6 +120,16 @@ struct __ptrace_syscall_info }; }; +/* Results of PTRACE_GET_RSEQ_CONFIGURATION. */ +struct __ptrace_rseq_configuration +{ + __uint64_t rseq_abi_pointer; + __uint32_t rseq_abi_size; + __uint32_t signature; + __uint32_t flags; + __uint32_t pad; +}; + /* Perform process tracing functions. REQUEST is one of the values above, and determines the action to be taken. For all requests except PTRACE_TRACEME, PID specifies the process to be diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h index bea975bb9e..536a0cafbd 100644 --- a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h @@ -153,8 +153,12 @@ enum __ptrace_request #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA /* Get information about system call. */ - PTRACE_GET_SYSCALL_INFO = 0x420e + PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION }; diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h index 032c91e817..fb599af6da 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h @@ -36,6 +36,7 @@ __BEGIN_DECLS # undef PTRACE_GETREGS # undef PTRACE_GETREGS64 # undef PTRACE_GETREGSET +# undef PTRACE_GET_RSEQ_CONFIGURATION # undef PTRACE_GETSIGINFO # undef PTRACE_GETSIGMASK # undef PTRACE_GET_SYSCALL_INFO @@ -260,8 +261,12 @@ enum __ptrace_request #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA /* Get information about system call. */ - PTRACE_GET_SYSCALL_INFO = 0x420e + PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION }; diff --git a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h index 4f3c65726f..3ddd2e4267 100644 --- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h @@ -86,6 +86,7 @@ __BEGIN_DECLS # undef PTRACE_SYSCALL_INFO_ENTRY # undef PTRACE_SYSCALL_INFO_EXIT # undef PTRACE_SYSCALL_INFO_SECCOMP +# undef PTRACE_GET_RSEQ_CONFIGURATION #endif /* Type of the REQUEST argument to `ptrace.' */ enum __ptrace_request @@ -217,6 +218,10 @@ enum __ptrace_request PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f, +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION + PTRACE_PEEKUSR_AREA = 0x5000, #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h index 3f61500284..773b437924 100644 --- a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h @@ -221,8 +221,12 @@ enum __ptrace_request #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA /* Get information about system call. */ - PTRACE_GET_SYSCALL_INFO = 0x420e + PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION }; diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h index dc76e97ea7..404fc3ddb7 100644 --- a/sysdeps/unix/sysv/linux/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/sys/ptrace.h @@ -170,8 +170,12 @@ enum __ptrace_request #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA /* Get information about system call. */ - PTRACE_GET_SYSCALL_INFO = 0x420e + PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION }; diff --git a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h index 8501cc22ed..7202a09eef 100644 --- a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h @@ -190,8 +190,12 @@ enum __ptrace_request #define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA /* Get information about system call. */ - PTRACE_GET_SYSCALL_INFO = 0x420e + PTRACE_GET_SYSCALL_INFO = 0x420e, #define PTRACE_GET_SYSCALL_INFO PTRACE_GET_SYSCALL_INFO + + /* Get rseq configuration information. */ + PTRACE_GET_RSEQ_CONFIGURATION = 0x420f +#define PTRACE_GET_RSEQ_CONFIGURATION PTRACE_GET_RSEQ_CONFIGURATION };