glibc: Add PTRACE_GET_RSEQ_CONFIGURATION

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).
This commit is contained in:
Yunfeng Ye 2022-03-03 04:32:31 -05:00
parent 35a62e41b1
commit 3247300521
2 changed files with 221 additions and 1 deletions

View File

@ -0,0 +1,216 @@
From 98149b16d645e9644a8e9b3d1f4b7932b9b193c5 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Mon, 9 Aug 2021 16:51:38 +0000
Subject: [PATCH] Add PTRACE_GET_RSEQ_CONFIGURATION from Linux 5.13 to
sys/ptrace.h
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.
---
sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h | 7 ++++++-
sysdeps/unix/sysv/linux/arm/sys/ptrace.h | 6 +++++-
sysdeps/unix/sysv/linux/bits/ptrace-shared.h | 10 ++++++++++
sysdeps/unix/sysv/linux/ia64/sys/ptrace.h | 6 +++++-
sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h | 7 ++++++-
sysdeps/unix/sysv/linux/s390/sys/ptrace.h | 5 +++++
sysdeps/unix/sysv/linux/sparc/sys/ptrace.h | 6 +++++-
sysdeps/unix/sysv/linux/sys/ptrace.h | 6 +++++-
sysdeps/unix/sysv/linux/x86/sys/ptrace.h | 6 +++++-
9 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
index af8193cbe7b2..1fae1dce9c6a 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 cdb1f159a7c1..2e3843664855 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 7d40634da55e..7e95ca7082e9 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 bea975bb9e3d..536a0cafbd1b 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 032c91e81791..fb599af6da64 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 4f3c65726f61..3ddd2e426789 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 3f6150028487..773b4379249c 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 dc76e97ea72a..404fc3ddb7b5 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 8501cc22ed7b..7202a09eefd3 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
};
--
2.27.0

View File

@ -66,7 +66,7 @@
############################################################################## ##############################################################################
Name: glibc Name: glibc
Version: 2.34 Version: 2.34
Release: 65 Release: 66
Summary: The GNU libc libraries Summary: The GNU libc libraries
License: %{all_license} License: %{all_license}
URL: http://www.gnu.org/software/glibc/ URL: http://www.gnu.org/software/glibc/
@ -200,6 +200,7 @@ Patch114: rseq-Linux-Use-ptrdiff_t-for-__rseq_offset.patch
Patch115: x86-Fallback-str-wcs-cmp-RTM-in-the-ncmp-overflow-ca.patch Patch115: x86-Fallback-str-wcs-cmp-RTM-in-the-ncmp-overflow-ca.patch
Patch116: x86-Test-wcscmp-RTM-in-the-wcsncmp-overflow-case-BZ-.patch Patch116: x86-Test-wcscmp-RTM-in-the-wcsncmp-overflow-case-BZ-.patch
Patch117: x86-Fix-TEST_NAME-to-make-it-a-string-in-tst-strncmp.patch Patch117: x86-Fix-TEST_NAME-to-make-it-a-string-in-tst-strncmp.patch
Patch118: Add-PTRACE_GET_RSEQ_CONFIGURATION-from-Linux-5.13-to.patch
Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch
Patch9001: delete-no-hard-link-to-avoid-all_language-package-to.patch Patch9001: delete-no-hard-link-to-avoid-all_language-package-to.patch
@ -1288,6 +1289,9 @@ fi
%endif %endif
%changelog %changelog
* Thu Mar 3 2022 Yunfeng Ye <yeyunfeng@huawei.com> - 2.34-66
- add PTRACE_GET_RSEQ_CONFIGURATION
* Thu Mar 3 2022 Qingqing Li <liqingqing3@huawei.com> - 2.34-65 * Thu Mar 3 2022 Qingqing Li <liqingqing3@huawei.com> - 2.34-65
- add chrpath to BuildRequires to make - add chrpath to BuildRequires to make
'remove shared library's RPATH/RUNPATH' to take effect 'remove shared library's RPATH/RUNPATH' to take effect