mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Audit the arguments to the ptrace(2) system call.
Obtained from: TrustedBSD Project Approved by: rwatson (mentor)
This commit is contained in:
parent
bfd7575a39
commit
085a0d43ca
1 changed files with 7 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$");
|
|||
|
||||
#include <machine/reg.h>
|
||||
|
||||
#include <security/audit/audit.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_extern.h>
|
||||
|
|
@ -404,6 +406,10 @@ ptrace(struct thread *td, struct ptrace_args *uap)
|
|||
if (td->td_proc->p_sysent == &ia32_freebsd_sysvec)
|
||||
wrap32 = 1;
|
||||
#endif
|
||||
AUDIT_ARG(pid, uap->pid);
|
||||
AUDIT_ARG(cmd, uap->req);
|
||||
AUDIT_ARG(addr, uap->addr);
|
||||
AUDIT_ARG(value, uap->data);
|
||||
addr = &r;
|
||||
switch (uap->req) {
|
||||
case PT_GETREGS:
|
||||
|
|
@ -551,6 +557,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
|
|||
pid = p->p_pid;
|
||||
}
|
||||
}
|
||||
AUDIT_ARG(process, p);
|
||||
if ((error = p_cansee(td, p)) != 0)
|
||||
goto fail;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue