Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions driver/ppm_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ int32_t parse_readv_writev_bufs(struct event_filler_arguments *args, const struc
{
int32_t res;
const struct iovec *iov;
u32 copylen;
u64 copylen;
u32 j;
u64 size = 0;
unsigned long bufsize;
Expand All @@ -1125,6 +1125,9 @@ int32_t parse_readv_writev_bufs(struct event_filler_arguments *args, const struc

copylen = iovcnt * sizeof(struct iovec);

if (unlikely(iovcnt >= 0xffffffff))
return PPM_FAILURE_BUFFER_FULL;

if (unlikely(copylen >= STR_STORAGE_SIZE))
return PPM_FAILURE_BUFFER_FULL;

Expand Down Expand Up @@ -1245,7 +1248,7 @@ int32_t compat_parse_readv_writev_bufs(struct event_filler_arguments *args, cons
{
int32_t res;
const struct compat_iovec *iov;
u32 copylen;
u64 copylen;
u32 j;
u64 size = 0;
unsigned long bufsize;
Expand All @@ -1258,6 +1261,9 @@ int32_t compat_parse_readv_writev_bufs(struct event_filler_arguments *args, cons

copylen = iovcnt * sizeof(struct compat_iovec);

if (unlikely(iovcnt >= 0xffffffff))
return PPM_FAILURE_BUFFER_FULL;

if (unlikely(copylen >= STR_STORAGE_SIZE))
return PPM_FAILURE_BUFFER_FULL;

Expand Down