提交 95609155 编写于 作者: F Florian Westphal 提交者: Pablo Neira Ayuso

netfilter: x_tables: remove obsolete overflow check for compat case too

commit 9e67d5a7
("[NETFILTER]: x_tables: remove obsolete overflow check") left the
compat parts alone, but we can kill it there as well.
Signed-off-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
上级 09d96860
...@@ -1436,8 +1436,6 @@ static int compat_do_replace(struct net *net, void __user *user, ...@@ -1436,8 +1436,6 @@ static int compat_do_replace(struct net *net, void __user *user,
return -EFAULT; return -EFAULT;
/* overflow check */ /* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters)) if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM; return -ENOMEM;
if (tmp.num_counters == 0) if (tmp.num_counters == 0)
......
...@@ -1706,8 +1706,6 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len) ...@@ -1706,8 +1706,6 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len)
return -EFAULT; return -EFAULT;
/* overflow check */ /* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters)) if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM; return -ENOMEM;
if (tmp.num_counters == 0) if (tmp.num_counters == 0)
......
...@@ -1709,8 +1709,6 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len) ...@@ -1709,8 +1709,6 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len)
return -EFAULT; return -EFAULT;
/* overflow check */ /* overflow check */
if (tmp.size >= INT_MAX / num_possible_cpus())
return -ENOMEM;
if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters)) if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
return -ENOMEM; return -ENOMEM;
if (tmp.num_counters == 0) if (tmp.num_counters == 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册