Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15338
b: refs/heads/master
c: 1b93ae6
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Dec 27, 2005
1 parent 88e2443 commit 14e26f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6732badee0dad467fcc9dd0168af8677b2b1bc2f
refs/heads/master: 1b93ae64cabe5e28dd5a1f35f96f938ca4f6ae20
3 changes: 0 additions & 3 deletions trunk/drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,6 @@ static int get_filter(void __user *arg, struct sock_filter **p)
if (copy_from_user(&uprog, arg, sizeof(uprog)))
return -EFAULT;

if (uprog.len > BPF_MAXINSNS)
return -EINVAL;

if (!uprog.len) {
*p = NULL;
return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
struct sock_filter *ftest;
int pc;

if (((unsigned int)flen >= (~0U / sizeof(struct sock_filter))) || flen == 0)
if (flen == 0 || flen > BPF_MAXINSNS)
return -EINVAL;

/* check the filter code now */
Expand Down Expand Up @@ -360,7 +360,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
int err;

/* Make sure new filter is there and in the right amounts. */
if (fprog->filter == NULL || fprog->len > BPF_MAXINSNS)
if (fprog->filter == NULL)
return -EINVAL;

fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL);
Expand Down

0 comments on commit 14e26f8

Please sign in to comment.