Limit size of passed in data for utrace function.
Requested by: rwatson Obtained from: NetBSD
This commit is contained in:
parent
0189f472ae
commit
0bad156a91
@ -48,6 +48,7 @@
|
||||
#include <sys/ktrace.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/sysent.h>
|
||||
|
||||
static MALLOC_DEFINE(M_KTRACE, "KTRACE", "KTRACE");
|
||||
|
||||
@ -359,6 +360,8 @@ utrace(curp, uap)
|
||||
|
||||
if (!KTRPOINT(p, KTR_USER))
|
||||
return (0);
|
||||
if (SCARG(uap, len) > KTR_USER_MAXLEN)
|
||||
return (EINVAL);
|
||||
p->p_traceflag |= KTRFAC_ACTIVE;
|
||||
kth = ktrgetheader(KTR_USER);
|
||||
MALLOC(cp, caddr_t, uap->len, M_KTRACE, M_WAITOK);
|
||||
|
@ -136,6 +136,7 @@ struct ktr_csw {
|
||||
/*
|
||||
* KTR_USER - data comming from userland
|
||||
*/
|
||||
#define KTR_USER_MAXLEN 2048 /* maximum length of passed data */
|
||||
#define KTR_USER 7
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user