Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14561
b: refs/heads/master
c: fb0d366
h: refs/heads/master
i:
  14559: 392504b
v: v3
  • Loading branch information
Kris Katterjohn authored and David S. Miller committed Nov 20, 2005
1 parent 564116e commit 330a32d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: aa8751667dcd757dd9a711b51140adf181501c44
refs/heads/master: fb0d366b0803571f06a5b838f02c6706fc287995
6 changes: 4 additions & 2 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
A /= X;
continue;
case BPF_ALU|BPF_DIV|BPF_K:
if (fentry->k == 0)
return 0;
A /= fentry->k;
continue;
case BPF_ALU|BPF_AND|BPF_X:
Expand Down Expand Up @@ -320,6 +318,10 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
}
}

/* check for division by zero -Kris Katterjohn 2005-10-30 */
if (ftest->code == (BPF_ALU|BPF_DIV|BPF_K) && ftest->k == 0)
return -EINVAL;

/* check that memory operations use valid addresses. */
if (ftest->k >= BPF_MEMWORDS) {
/* but it might not be a memory operation... */
Expand Down

0 comments on commit 330a32d

Please sign in to comment.