Add PTRACE_GET_RSEQ_CONFIGURATION from Linux 5.13 to sys/ptrace.h
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
success
|
Build for i686
|
Commit Message
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.
Comments
On Fri, Aug 06, 2021 at 10:45:47PM +0000, Joseph Myers wrote:
> 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).
Yes, this looks correct, the new ptrace operation was introduced by
Linux kernel commit v5.13-rc1~118^2~38.
@@ -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
};
@@ -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
};
@@ -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
@@ -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
};
@@ -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
};
@@ -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
@@ -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
};
@@ -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
};
@@ -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
};