You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the prctl() call to let the parent process and its children open
IPC handle.
This is a more secure way than setting the ptrace_scope to 0 globally
for all processes in the system.
Co-authored-by: [email protected]
IPC API uses file descriptor duplication, which requires the `pidfd_getfd(2)` system call to obtain a duplicate of another process's file descriptor. This system call is supported since Linux 5.6. Permission to duplicate another process's file descriptor is governed by the `PTRACE_MODE_ATTACH_REALCREDS` check (see `ptrace(2)`). To allow file descriptor duplication in a binary that opens IPC handle, you can call `prctl(PR_SET_PTRACER, getppid())`.
164
156
165
157
There are available two mechanisms for the shared memory mapping:
166
158
1) a named shared memory object (used if the `shm_name` parameter is not NULL) or
@@ -184,15 +176,7 @@ Packages required for tests (Linux-only yet):
184
176
185
177
A memory provider that provides memory from L0 device.
186
178
187
-
IPC API uses the file descriptor duplication. It requires using `pidfd_getfd(2)` to obtain
188
-
a duplicate of another process's file descriptor (`pidfd_getfd(2)` is supported since Linux 5.6).
189
-
Permission to duplicate another process's file descriptor is governed by a ptrace access mode
190
-
`PTRACE_MODE_ATTACH_REALCREDS` check (see `ptrace(2)`) that can be changed using
191
-
the `/proc/sys/kernel/yama/ptrace_scope` interface in the following way:
IPC API uses file descriptor duplication, which requires the `pidfd_getfd(2)` system call to obtain a duplicate of another process's file descriptor. This system call is supported since Linux 5.6. Permission to duplicate another process's file descriptor is governed by the `PTRACE_MODE_ATTACH_REALCREDS` check (see `ptrace(2)`). To allow file descriptor duplication in a binary that opens IPC handle, you can call `prctl(PR_SET_PTRACER, getppid())`.
196
180
197
181
##### Requirements
198
182
@@ -345,7 +329,7 @@ The memory used by the proxy memory allocator is mmap'ed:
345
329
1) with the `MAP_PRIVATE` flag by default or
346
330
2) with the `MAP_SHARED` flag if the `UMF_PROXY` environment variable contains one of two following strings: `page.disposition=shared-shm` or `page.disposition=shared-fd`. These two options differ in a mechanism used during IPC:
347
331
-`page.disposition=shared-shm` - IPC uses the named shared memory. An SHM name is generated using the `umf_proxy_lib_shm_pid_$PID` pattern, where `$PID` is the PID of the process. It creates the `/dev/shm/umf_proxy_lib_shm_pid_$PID` file.
348
-
-`page.disposition=shared-fd` - IPC uses the file descriptor duplication. It requires using`pidfd_getfd(2)` to obtain a duplicate of another process's file descriptor. Permission to duplicate another process's file descriptor is governed by a ptrace access mode `PTRACE_MODE_ATTACH_REALCREDS` check (see `ptrace(2)`) that can be changed using the `/proc/sys/kernel/yama/ptrace_scope` interface. `pidfd_getfd(2)` is supported since Linux 5.6.
332
+
-`page.disposition=shared-fd` - IPC API uses file descriptor duplication, which requires the`pidfd_getfd(2)`system call to obtain a duplicate of another process's file descriptor. This system call is supported since Linux 5.6. Permission to duplicate another process's file descriptor is governed by the `PTRACE_MODE_ATTACH_REALCREDS` check (see `ptrace(2)`). To allow file descriptor duplication in a binary that opens IPC handle, you can call `prctl(PR_SET_PTRACER, getppid())`.
0 commit comments