-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cptbox/isolate: print target of denied
*kill
and prlimit
syscalls
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,13 +390,15 @@ def _access_check(self, debugger: Debugger, file: str, fs_jail: FilesystemPolicy | |
|
||
def handle_kill(self, debugger: Debugger) -> None: | ||
# Allow tgkill to execute as long as the target thread group is the debugged process | ||
# libstdc++ seems to use this to signal itself, see <https://github.com/DMOJ/judge/issues/183> | ||
if debugger.uarg0 != debugger.pid: | ||
raise DeniedSyscall(ACCESS_EPERM, 'Cannot kill other processes') | ||
# libstdc++ seems to use this to signal itself, see <https://github.com/DMOJ/judge/issues/18A3> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
int-y1
Contributor
|
||
target = debugger.uarg0 | ||
if target != debugger.pid: | ||
raise DeniedSyscall(ACCESS_EPERM, f'Cannot kill other processes (target={target}, self={debugger.pid})') | ||
|
||
def handle_prlimit(self, debugger: Debugger) -> None: | ||
if debugger.uarg0 not in (0, debugger.pid): | ||
raise DeniedSyscall(ACCESS_EPERM, 'Cannot prlimit other processes') | ||
target = debugger.uarg0 | ||
if target not in (0, debugger.pid): | ||
raise DeniedSyscall(ACCESS_EPERM, f'Cannot prlimit other processes (target={target}, self={debugger.pid})') | ||
|
||
def handle_prctl(self, debugger: Debugger) -> None: | ||
PR_GET_DUMPABLE = 3 | ||
|
18A3 seems like typo