diff options
-rw-r--r-- | net/bridge/netfilter/ebtables.c | 5 | ||||
-rw-r--r-- | net/ipv4/netfilter/arp_tables.c | 6 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 6 |
4 files changed, 14 insertions, 9 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 0e474b13463b..1059ed3bc255 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -1044,10 +1044,9 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl, | |||
1044 | if (repl->num_counters && | 1044 | if (repl->num_counters && |
1045 | copy_to_user(repl->counters, counterstmp, | 1045 | copy_to_user(repl->counters, counterstmp, |
1046 | repl->num_counters * sizeof(struct ebt_counter))) { | 1046 | repl->num_counters * sizeof(struct ebt_counter))) { |
1047 | ret = -EFAULT; | 1047 | /* Silent error, can't fail, new table is already in place */ |
1048 | net_warn_ratelimited("ebtables: counters copy to user failed while replacing table\n"); | ||
1048 | } | 1049 | } |
1049 | else | ||
1050 | ret = 0; | ||
1051 | 1050 | ||
1052 | /* decrease module count and free resources */ | 1051 | /* decrease module count and free resources */ |
1053 | EBT_ENTRY_ITERATE(table->entries, table->entries_size, | 1052 | EBT_ENTRY_ITERATE(table->entries, table->entries_size, |
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index 59da7cde0724..f95b6f93814b 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -1044,8 +1044,10 @@ static int __do_replace(struct net *net, const char *name, | |||
1044 | 1044 | ||
1045 | xt_free_table_info(oldinfo); | 1045 | xt_free_table_info(oldinfo); |
1046 | if (copy_to_user(counters_ptr, counters, | 1046 | if (copy_to_user(counters_ptr, counters, |
1047 | sizeof(struct xt_counters) * num_counters) != 0) | 1047 | sizeof(struct xt_counters) * num_counters) != 0) { |
1048 | ret = -EFAULT; | 1048 | /* Silent error, can't fail, new table is already in place */ |
1049 | net_warn_ratelimited("arptables: counters copy to user failed while replacing table\n"); | ||
1050 | } | ||
1049 | vfree(counters); | 1051 | vfree(counters); |
1050 | xt_table_unlock(t); | 1052 | xt_table_unlock(t); |
1051 | return ret; | 1053 | return ret; |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index 718dfbd30cbe..99e810f84671 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -1231,8 +1231,10 @@ __do_replace(struct net *net, const char *name, unsigned int valid_hooks, | |||
1231 | 1231 | ||
1232 | xt_free_table_info(oldinfo); | 1232 | xt_free_table_info(oldinfo); |
1233 | if (copy_to_user(counters_ptr, counters, | 1233 | if (copy_to_user(counters_ptr, counters, |
1234 | sizeof(struct xt_counters) * num_counters) != 0) | 1234 | sizeof(struct xt_counters) * num_counters) != 0) { |
1235 | ret = -EFAULT; | 1235 | /* Silent error, can't fail, new table is already in place */ |
1236 | net_warn_ratelimited("iptables: counters copy to user failed while replacing table\n"); | ||
1237 | } | ||
1236 | vfree(counters); | 1238 | vfree(counters); |
1237 | xt_table_unlock(t); | 1239 | xt_table_unlock(t); |
1238 | return ret; | 1240 | return ret; |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 710238f58aa9..e080fbbbc0e5 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -1241,8 +1241,10 @@ __do_replace(struct net *net, const char *name, unsigned int valid_hooks, | |||
1241 | 1241 | ||
1242 | xt_free_table_info(oldinfo); | 1242 | xt_free_table_info(oldinfo); |
1243 | if (copy_to_user(counters_ptr, counters, | 1243 | if (copy_to_user(counters_ptr, counters, |
1244 | sizeof(struct xt_counters) * num_counters) != 0) | 1244 | sizeof(struct xt_counters) * num_counters) != 0) { |
1245 | ret = -EFAULT; | 1245 | /* Silent error, can't fail, new table is already in place */ |
1246 | net_warn_ratelimited("ip6tables: counters copy to user failed while replacing table\n"); | ||
1247 | } | ||
1246 | vfree(counters); | 1248 | vfree(counters); |
1247 | xt_table_unlock(t); | 1249 | xt_table_unlock(t); |
1248 | return ret; | 1250 | return ret; |