[NET]: Validate socket filters against BPF_MAXINSNS in one spot.
Currently the checks are scattered all over and this leads to inconsistencies and even cases where the check is not made. Based upon a patch from Kris Katterjohn. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user