Skip to content

Commit

Permalink
[NETFILTER]: x_tables: remove obsolete overflow check
Browse files Browse the repository at this point in the history
We're not multiplying the size with the number of CPUs anymore, so the
check is obsolete.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jan 28, 2008
1 parent 259d4e4 commit 9e67d5a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions net/ipv4/netfilter/arp_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,6 @@ static int do_replace(void __user *user, unsigned int len)
return -ENOPROTOOPT;

/* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM;

Expand Down
2 changes: 0 additions & 2 deletions net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,8 +1323,6 @@ do_replace(void __user *user, unsigned int len)
return -ENOPROTOOPT;

/* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM;

Expand Down
2 changes: 0 additions & 2 deletions net/ipv6/netfilter/ip6_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,6 @@ do_replace(void __user *user, unsigned int len)
return -EFAULT;

/* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM;

Expand Down

0 comments on commit 9e67d5a

Please sign in to comment.