Skip to content

Commit

Permalink
netfilter: x_tables: remove size check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michal Hocko authored and Pablo Neira Ayuso committed Feb 8, 2018
1 parent 5c487bb commit fd2c19b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/netfilter/x_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd2c19b

Please sign in to comment.