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
Update our documentation with better info about ptrace - IPC users
should be aware of required permissions. Add proposed, one of the
solutions into our docs. Also, update our examples and tests to work
without global change of ptrace_scope.
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())` in the producer binary that gets the IPC handle.
171
163
172
164
There are available two mechanisms for the shared memory mapping:
173
165
@@ -194,15 +186,7 @@ Packages required for tests (Linux-only yet):
194
186
195
187
A memory provider that provides memory from L0 device.
196
188
197
-
IPC API uses the file descriptor duplication. It requires using `pidfd_getfd(2)` to obtain
198
-
a duplicate of another process's file descriptor (`pidfd_getfd(2)` is supported since Linux 5.6).
199
-
Permission to duplicate another process's file descriptor is governed by a ptrace access mode
200
-
`PTRACE_MODE_ATTACH_REALCREDS` check (see `ptrace(2)`) that can be changed using
201
-
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())` in the producer binary that gets the IPC handle.
206
190
207
191
##### Requirements
208
192
@@ -359,7 +343,7 @@ The memory used by the proxy memory allocator is mmap'ed:
359
343
1) with the `MAP_PRIVATE` flag by default or
360
344
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:
361
345
-`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.
362
-
-`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.
346
+
-`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())` in the producer binary that gets the IPC handle.
0 commit comments