Skip to content

Commit 9560915

Browse files
Florian Westphalummakynes
authored andcommitted
netfilter: x_tables: remove obsolete overflow check for compat case too
commit 9e67d5a ("[NETFILTER]: x_tables: remove obsolete overflow check") left the compat parts alone, but we can kill it there as well. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 09d9686 commit 9560915

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
@@ -1436,8 +1436,6 @@ static int compat_do_replace(struct net *net, void __user *user,
14361436
return -EFAULT;
14371437

14381438
/* overflow check */
1439-
if (tmp.size >= INT_MAX / num_possible_cpus())
1440-
return -ENOMEM;
14411439
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
14421440
return -ENOMEM;
14431441
if (tmp.num_counters == 0)

net/ipv4/netfilter/ip_tables.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,8 +1706,6 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len)
17061706
return -EFAULT;
17071707

17081708
/* overflow check */
1709-
if (tmp.size >= INT_MAX / num_possible_cpus())
1710-
return -ENOMEM;
17111709
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
17121710
return -ENOMEM;
17131711
if (tmp.num_counters == 0)

net/ipv6/netfilter/ip6_tables.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,8 +1709,6 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len)
17091709
return -EFAULT;
17101710

17111711
/* overflow check */
1712-
if (tmp.size >= INT_MAX / num_possible_cpus())
1713-
return -ENOMEM;
17141712
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
17151713
return -ENOMEM;
17161714
if (tmp.num_counters == 0)

0 commit comments

Comments
 (0)