mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-22 15:47:37 +00: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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=155634
@ -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 New Issue
Block a user