Skip to content

Commit 9e67d5a

Browse files
kaberdavem330
authored andcommitted
[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: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 259d4e4 commit 9e67d5a

File tree

3 files changed

+0
-6
lines changed

3 files changed

+0
-6
lines changed

net/ipv4/netfilter/arp_tables.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,6 @@ static int do_replace(void __user *user, unsigned int len)
811811
return -ENOPROTOOPT;
812812

813813
/* overflow check */
814-
if (tmp.size >= INT_MAX / num_possible_cpus())
815-
return -ENOMEM;
816814
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
817815
return -ENOMEM;
818816

net/ipv4/netfilter/ip_tables.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,8 +1323,6 @@ do_replace(void __user *user, unsigned int len)
13231323
return -ENOPROTOOPT;
13241324

13251325
/* overflow check */
1326-
if (tmp.size >= INT_MAX / num_possible_cpus())
1327-
return -ENOMEM;
13281326
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
13291327
return -ENOMEM;
13301328

net/ipv6/netfilter/ip6_tables.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,6 @@ do_replace(void __user *user, unsigned int len)
10421042
return -EFAULT;
10431043

10441044
/* overflow check */
1045-
if (tmp.size >= INT_MAX / num_possible_cpus())
1046-
return -ENOMEM;
10471045
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
10481046
return -ENOMEM;
10491047

0 commit comments

Comments
 (0)