netfilter: x_tables: remove obsolete overflow check for compat case too
authorFlorian Westphal <fw@strlen.de>
Fri, 1 Apr 2016 12:17:35 +0000 (14:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 13 Apr 2016 22:30:40 +0000 (00:30 +0200)
commit 9e67d5a739327c44885adebb4f3a538050be73e4
("[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>
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c

index 705179b0fd2390276531354740d3b1512b2a5f3f..668c5dcb3a5fd132fb064df77a9f21252b6300e3 100644 (file)
@@ -1436,8 +1436,6 @@ static int compat_do_replace(struct net *net, void __user *user,
                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;
        if (tmp.num_counters == 0)
index c26ccd818e8f46e095e789e2b16a828fa36434a0..4585aa78c4cae4fc46f0dc35a418b1e06d8bb2cc 100644 (file)
@@ -1706,8 +1706,6 @@ compat_do_replace(struct net *net, 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;
        if (tmp.num_counters == 0)
index f5a4eb2d5084cb32f8e593aedd173f21545a7842..fd06251f504c1f14a1b72ed51c9627f89d2f2871 100644 (file)
@@ -1709,8 +1709,6 @@ compat_do_replace(struct net *net, 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;
        if (tmp.num_counters == 0)