Skip to content

Commit 9a7a3f1

Browse files
authored
Merge pull request #4386 from devnexen/linux_ptrace_sud_config
adding linux glibc ptrace_sud_config and related PTRACE_*ET_SYSCALL_U…
2 parents 564b72b + 795a6d6 commit 9a7a3f1

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

libc-test/build.rs

+5
Original file line numberDiff line numberDiff line change
@@ -4124,6 +4124,9 @@ fn test_linux(target: &str) {
41244124
// FIXME(linux): Requires >= 6.12 kernel headers.
41254125
"dmabuf_cmsg" | "dmabuf_token" => true,
41264126

4127+
// FIXME(linux): Requires >= 6.4 kernel headers.
4128+
"ptrace_sud_config" => true,
4129+
41274130
_ => false,
41284131
}
41294132
});
@@ -4548,6 +4551,8 @@ fn test_linux(target: &str) {
45484551
| "SO_DEVMEM_DONTNEED"
45494552
| "SCM_DEVMEM_LINEAR"
45504553
| "SCM_DEVMEM_DMABUF" => true,
4554+
// FIXME(linux): Requires >= 6.4 kernel headers.
4555+
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG" | "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,
45514556

45524557
_ => false,
45534558
}

libc-test/semver/linux-gnu.txt

+3
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ PR_SET_VMA
348348
PR_SET_VMA_ANON_NAME
349349
PTHREAD_MUTEX_ADAPTIVE_NP
350350
PTRACE_GET_SYSCALL_INFO
351+
PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG
352+
PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG
351353
PTRACE_SYSCALL_INFO_ENTRY
352354
PTRACE_SYSCALL_INFO_EXIT
353355
PTRACE_SYSCALL_INFO_NONE
@@ -652,6 +654,7 @@ pthread_rwlockattr_getkind_np
652654
pthread_rwlockattr_getpshared
653655
pthread_rwlockattr_setkind_np
654656
ptrace_peeksiginfo_args
657+
ptrace_sud_config
655658
ptrace_syscall_info
656659
putgrent
657660
putpwent

src/unix/linux_like/linux/gnu/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ s! {
310310
pub u: __c_anonymous_ptrace_syscall_info_data,
311311
}
312312

313+
pub struct ptrace_sud_config {
314+
pub mode: crate::__u64,
315+
pub selector: crate::__u64,
316+
pub offset: crate::__u64,
317+
pub len: crate::__u64,
318+
}
319+
313320
pub struct iocb {
314321
pub aio_data: crate::__u64,
315322
#[cfg(target_endian = "little")]
@@ -937,6 +944,8 @@ pub const PTRACE_SYSCALL_INFO_NONE: crate::__u8 = 0;
937944
pub const PTRACE_SYSCALL_INFO_ENTRY: crate::__u8 = 1;
938945
pub const PTRACE_SYSCALL_INFO_EXIT: crate::__u8 = 2;
939946
pub const PTRACE_SYSCALL_INFO_SECCOMP: crate::__u8 = 3;
947+
pub const PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG: crate::__u8 = 0x4210;
948+
pub const PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG: crate::__u8 = 0x4211;
940949

941950
// linux/fs.h
942951

src/unix/solarish/solaris.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::prelude::*;
22
use crate::{
3-
exit_status, off_t, NET_MAC_AWARE, NET_MAC_AWARE_INHERIT, PRIV_AWARE_RESET, PRIV_DEBUG,
4-
PRIV_PFEXEC, PRIV_XPOLICY, termios,
3+
exit_status, off_t, termios, NET_MAC_AWARE, NET_MAC_AWARE_INHERIT, PRIV_AWARE_RESET,
4+
PRIV_DEBUG, PRIV_PFEXEC, PRIV_XPOLICY,
55
};
66

77
pub type door_attr_t = c_uint;

0 commit comments

Comments
 (0)