Commit 9e67d5a7 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: x_tables: remove obsolete overflow check

We're not multiplying the size with the number of CPUs anymore, so the
check is obsolete.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 259d4e41
...@@ -811,8 +811,6 @@ static int do_replace(void __user *user, unsigned int len) ...@@ -811,8 +811,6 @@ static int do_replace(void __user *user, unsigned int len)
return -ENOPROTOOPT; return -ENOPROTOOPT;
/* overflow check */ /* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters)) if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM; return -ENOMEM;
......
...@@ -1323,8 +1323,6 @@ do_replace(void __user *user, unsigned int len) ...@@ -1323,8 +1323,6 @@ do_replace(void __user *user, unsigned int len)
return -ENOPROTOOPT; return -ENOPROTOOPT;
/* overflow check */ /* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters)) if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM; return -ENOMEM;
......
...@@ -1042,8 +1042,6 @@ do_replace(void __user *user, unsigned int len) ...@@ -1042,8 +1042,6 @@ do_replace(void __user *user, unsigned int len)
return -EFAULT; return -EFAULT;
/* overflow check */ /* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters)) if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment