]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
netfilter: x_tables: remove size check
authorMichal Hocko <mhocko@suse.com>
Wed, 31 Jan 2018 08:16:56 +0000 (09:16 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 8 Feb 2018 11:36:15 +0000 (12:36 +0100)
Back in 2002 vmalloc used to BUG on too large sizes.  We are much better
behaved these days and vmalloc simply returns NULL for those.  Remove the
check as it simply not needed and the comment is even misleading.

Link: http://lkml.kernel.org/r/20180131081916.GO21609@dhcp22.suse.cz
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Florian Westphal <fw@strlen.de>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/x_tables.c

index 2f685ee1f9c87dc6cee3b1c333e7d62ad36de806..97e06a04c0d4e177be1fc2c3b40e44ffe0a98370 100644 (file)
@@ -1004,10 +1004,6 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
        if (sz < sizeof(*info))
                return NULL;
 
-       /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
-       if ((size >> PAGE_SHIFT) + 2 > totalram_pages)
-               return NULL;
-
        /* __GFP_NORETRY is not fully supported by kvmalloc but it should
         * work reasonably well if sz is too large and bail out rather
         * than shoot all processes down before realizing there is nothing