]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv4/netfilter/arp_tables.c
netfilter: Can't fail and free after table replacement
[karo-tx-linux.git] / net / ipv4 / netfilter / arp_tables.c
index 59da7cde072447c2331422659adb7dadad4f3fae..f95b6f93814b95b2c810eff8d4573a996f9a9f63 100644 (file)
@@ -1044,8 +1044,10 @@ static int __do_replace(struct net *net, const char *name,
 
        xt_free_table_info(oldinfo);
        if (copy_to_user(counters_ptr, counters,
-                        sizeof(struct xt_counters) * num_counters) != 0)
-               ret = -EFAULT;
+                        sizeof(struct xt_counters) * num_counters) != 0) {
+               /* Silent error, can't fail, new table is already in place */
+               net_warn_ratelimited("arptables: counters copy to user failed while replacing table\n");
+       }
        vfree(counters);
        xt_table_unlock(t);
        return ret;