···120120 const struct xt_audit_info *info = par->targinfo;121121122122 if (info->type > XT_AUDIT_TYPE_MAX) {123123- pr_info("Audit type out of range (valid range: 0..%hhu)\n",124124- XT_AUDIT_TYPE_MAX);123123+ pr_info_ratelimited("Audit type out of range (valid range: 0..%hhu)\n",124124+ XT_AUDIT_TYPE_MAX);125125 return -ERANGE;126126 }127127
···102102 break;103103104104 default:105105- pr_info("invalid mode: %hu\n", info->mode);105105+ pr_info_ratelimited("invalid mode: %hu\n", info->mode);106106 return -EINVAL;107107 }108108109109 ret = nf_ct_netns_get(par->net, par->family);110110 if (ret < 0)111111- pr_info("cannot load conntrack support for proto=%u\n",112112- par->family);111111+ pr_info_ratelimited("cannot load conntrack support for proto=%u\n",112112+ par->family);113113 return ret;114114}115115
+1-1
net/netfilter/xt_LED.c
···136136137137 err = led_trigger_register(&ledinternal->netfilter_led_trigger);138138 if (err) {139139- pr_err("Trigger name is already in use.\n");139139+ pr_info_ratelimited("Trigger name is already in use.\n");140140 goto exit_alloc;141141 }142142
+8-6
net/netfilter/xt_SECMARK.c
···6060 &info->secid);6161 if (err) {6262 if (err == -EINVAL)6363- pr_info("invalid security context \'%s\'\n", info->secctx);6363+ pr_info_ratelimited("invalid security context \'%s\'\n",6464+ info->secctx);6465 return err;6566 }66676768 if (!info->secid) {6868- pr_info("unable to map security context \'%s\'\n", info->secctx);6969+ pr_info_ratelimited("unable to map security context \'%s\'\n",7070+ info->secctx);6971 return -ENOENT;7072 }71737274 err = security_secmark_relabel_packet(info->secid);7375 if (err) {7474- pr_info("unable to obtain relabeling permission\n");7676+ pr_info_ratelimited("unable to obtain relabeling permission\n");7577 return err;7678 }7779···9492 }95939694 if (mode && mode != info->mode) {9797- pr_info("mode already set to %hu cannot mix with "9898- "rules for mode %hu\n", mode, info->mode);9595+ pr_info_ratelimited("mode already set to %hu cannot mix with rules for mode %hu\n",9696+ mode, info->mode);9997 return -EINVAL;10098 }10199···103101 case SECMARK_MODE_SEL:104102 break;105103 default:106106- pr_info("invalid mode: %hu\n", info->mode);104104+ pr_info_ratelimited("invalid mode: %hu\n", info->mode);107105 return -EINVAL;108106 }109107
+4-6
net/netfilter/xt_TCPMSS.c
···273273 (par->hook_mask & ~((1 << NF_INET_FORWARD) |274274 (1 << NF_INET_LOCAL_OUT) |275275 (1 << NF_INET_POST_ROUTING))) != 0) {276276- pr_info("path-MTU clamping only supported in "277277- "FORWARD, OUTPUT and POSTROUTING hooks\n");276276+ pr_info_ratelimited("path-MTU clamping only supported in FORWARD, OUTPUT and POSTROUTING hooks\n");278277 return -EINVAL;279278 }280279 if (par->nft_compat)···282283 xt_ematch_foreach(ematch, e)283284 if (find_syn_match(ematch))284285 return 0;285285- pr_info("Only works on TCP SYN packets\n");286286+ pr_info_ratelimited("Only works on TCP SYN packets\n");286287 return -EINVAL;287288}288289···297298 (par->hook_mask & ~((1 << NF_INET_FORWARD) |298299 (1 << NF_INET_LOCAL_OUT) |299300 (1 << NF_INET_POST_ROUTING))) != 0) {300300- pr_info("path-MTU clamping only supported in "301301- "FORWARD, OUTPUT and POSTROUTING hooks\n");301301+ pr_info_ratelimited("path-MTU clamping only supported in FORWARD, OUTPUT and POSTROUTING hooks\n");302302 return -EINVAL;303303 }304304 if (par->nft_compat)···306308 xt_ematch_foreach(ematch, e)307309 if (find_syn_match(ematch))308310 return 0;309309- pr_info("Only works on TCP SYN packets\n");311311+ pr_info_ratelimited("Only works on TCP SYN packets\n");310312 return -EINVAL;311313}312314#endif
+2-4
net/netfilter/xt_TPROXY.c
···540540 !(i->invflags & IP6T_INV_PROTO))541541 return 0;542542543543- pr_info("Can be used only in combination with "544544- "either -p tcp or -p udp\n");543543+ pr_info_ratelimited("Can be used only with -p tcp or -p udp\n");545544 return -EINVAL;546545}547546#endif···558559 && !(i->invflags & IPT_INV_PROTO))559560 return 0;560561561561- pr_info("Can be used only in combination with "562562- "either -p tcp or -p udp\n");562562+ pr_info_ratelimited("Can be used only with -p tcp or -p udp\n");563563 return -EINVAL;564564}565565
+3-1
net/netfilter/xt_bpf.c
···77 * published by the Free Software Foundation.88 */991010+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1111+1012#include <linux/module.h>1113#include <linux/syscalls.h>1214#include <linux/skbuff.h>···3634 program.filter = insns;37353836 if (bpf_prog_create(ret, &program)) {3939- pr_info("bpf: check failed: parse error\n");3737+ pr_info_ratelimited("check failed: parse error\n");4038 return -EINVAL;4139 }4240
+5-3
net/netfilter/xt_cgroup.c
···1212 * published by the Free Software Foundation.1313 */14141515+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1616+1517#include <linux/skbuff.h>1618#include <linux/module.h>1719#include <linux/netfilter/x_tables.h>···5048 }51495250 if (info->has_path && info->has_classid) {5353- pr_info("xt_cgroup: both path and classid specified\n");5151+ pr_info_ratelimited("path and classid specified\n");5452 return -EINVAL;5553 }5654···5856 if (info->has_path) {5957 cgrp = cgroup_get_from_path(info->path);6058 if (IS_ERR(cgrp)) {6161- pr_info("xt_cgroup: invalid path, errno=%ld\n",6262- PTR_ERR(cgrp));5959+ pr_info_ratelimited("invalid path, errno=%ld\n",6060+ PTR_ERR(cgrp));6361 return -EINVAL;6462 }6563 info->priv = cgrp;
+3-5
net/netfilter/xt_cluster.c
···135135 struct xt_cluster_match_info *info = par->matchinfo;136136137137 if (info->total_nodes > XT_CLUSTER_NODES_MAX) {138138- pr_info("you have exceeded the maximum "139139- "number of cluster nodes (%u > %u)\n",140140- info->total_nodes, XT_CLUSTER_NODES_MAX);138138+ pr_info_ratelimited("you have exceeded the maximum number of cluster nodes (%u > %u)\n",139139+ info->total_nodes, XT_CLUSTER_NODES_MAX);141140 return -EINVAL;142141 }143142 if (info->node_mask >= (1ULL << info->total_nodes)) {144144- pr_info("this node mask cannot be "145145- "higher than the total number of nodes\n");143143+ pr_info_ratelimited("node mask cannot exceed total number of nodes\n");146144 return -EDOM;147145 }148146 return 0;
+2-2
net/netfilter/xt_connbytes.c
···112112113113 ret = nf_ct_netns_get(par->net, par->family);114114 if (ret < 0)115115- pr_info("cannot load conntrack support for proto=%u\n",116116- par->family);115115+ pr_info_ratelimited("cannot load conntrack support for proto=%u\n",116116+ par->family);117117118118 /*119119 * This filter cannot function correctly unless connection tracking
+4-3
net/netfilter/xt_connlabel.c
···5757 int ret;58585959 if (info->options & ~options) {6060- pr_err("Unknown options in mask %x\n", info->options);6060+ pr_info_ratelimited("Unknown options in mask %x\n",6161+ info->options);6162 return -EINVAL;6263 }63646465 ret = nf_ct_netns_get(par->net, par->family);6566 if (ret < 0) {6666- pr_info("cannot load conntrack support for proto=%u\n",6767- par->family);6767+ pr_info_ratelimited("cannot load conntrack support for proto=%u\n",6868+ par->family);6869 return ret;6970 }7071
+4-4
net/netfilter/xt_connmark.c
···79798080 ret = nf_ct_netns_get(par->net, par->family);8181 if (ret < 0)8282- pr_info("cannot load conntrack support for proto=%u\n",8383- par->family);8282+ pr_info_ratelimited("cannot load conntrack support for proto=%u\n",8383+ par->family);8484 return ret;8585}8686···109109110110 ret = nf_ct_netns_get(par->net, par->family);111111 if (ret < 0)112112- pr_info("cannot load conntrack support for proto=%u\n",113113- par->family);112112+ pr_info_ratelimited("cannot load conntrack support for proto=%u\n",113113+ par->family);114114 return ret;115115}116116
+2-2
net/netfilter/xt_conntrack.c
···272272273273 ret = nf_ct_netns_get(par->net, par->family);274274 if (ret < 0)275275- pr_info("cannot load conntrack support for proto=%u\n",276276- par->family);275275+ pr_info_ratelimited("cannot load conntrack support for proto=%u\n",276276+ par->family);277277 return ret;278278}279279
+2-2
net/netfilter/xt_ecn.c
···97979898 if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) &&9999 (ip->proto != IPPROTO_TCP || ip->invflags & IPT_INV_PROTO)) {100100- pr_info("cannot match TCP bits in rule for non-tcp packets\n");100100+ pr_info_ratelimited("cannot match TCP bits for non-tcp packets\n");101101 return -EINVAL;102102 }103103···139139140140 if (info->operation & (XT_ECN_OP_MATCH_ECE | XT_ECN_OP_MATCH_CWR) &&141141 (ip->proto != IPPROTO_TCP || ip->invflags & IP6T_INV_PROTO)) {142142- pr_info("cannot match TCP bits in rule for non-tcp packets\n");142142+ pr_info_ratelimited("cannot match TCP bits for non-tcp packets\n");143143 return -EINVAL;144144 }145145
···88 * published by the Free Software Foundation.99 */10101111+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1212+1113#include <linux/module.h>1214#include <linux/skbuff.h>1315#include <linux/netfilter.h>···2119 const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;22202321 if (mr->rangesize != 1) {2424- pr_info("%s: multiple ranges no longer supported\n",2525- par->target->name);2222+ pr_info_ratelimited("multiple ranges no longer supported\n");2623 return -EINVAL;2724 }2825 return nf_ct_netns_get(par->net, par->family);
+4-2
net/netfilter/xt_nfacct.c
···66 * it under the terms of the GNU General Public License version 2 (or any77 * later at your option) as published by the Free Software Foundation.88 */99+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1010+911#include <linux/module.h>1012#include <linux/skbuff.h>1113···41394240 nfacct = nfnl_acct_find_get(par->net, info->name);4341 if (nfacct == NULL) {4444- pr_info("xt_nfacct: accounting object with name `%s' "4545- "does not exists\n", info->name);4242+ pr_info_ratelimited("accounting object `%s' does not exists\n",4343+ info->name);4644 return -ENOENT;4745 }4846 info->nfacct = nfacct;
+1-3
net/netfilter/xt_physdev.c
···107107 info->invert & XT_PHYSDEV_OP_BRIDGED) &&108108 par->hook_mask & ((1 << NF_INET_LOCAL_OUT) |109109 (1 << NF_INET_FORWARD) | (1 << NF_INET_POST_ROUTING))) {110110- pr_info("using --physdev-out and --physdev-is-out are only "111111- "supported in the FORWARD and POSTROUTING chains with "112112- "bridged traffic.\n");110110+ pr_info_ratelimited("--physdev-out and --physdev-is-out only supported in the FORWARD and POSTROUTING chains with bridged traffic\n");113111 if (par->hook_mask & (1 << NF_INET_LOCAL_OUT))114112 return -EINVAL;115113 }
+6-8
net/netfilter/xt_recent.c
···342342 net_get_random_once(&hash_rnd, sizeof(hash_rnd));343343344344 if (info->check_set & ~XT_RECENT_VALID_FLAGS) {345345- pr_info("Unsupported user space flags (%08x)\n",346346- info->check_set);345345+ pr_info_ratelimited("Unsupported userspace flags (%08x)\n",346346+ info->check_set);347347 return -EINVAL;348348 }349349 if (hweight8(info->check_set &···357357 if ((info->check_set & XT_RECENT_REAP) && !info->seconds)358358 return -EINVAL;359359 if (info->hit_count >= XT_RECENT_MAX_NSTAMPS) {360360- pr_info("hitcount (%u) is larger than allowed maximum (%u)\n",361361- info->hit_count, XT_RECENT_MAX_NSTAMPS - 1);360360+ pr_info_ratelimited("hitcount (%u) is larger than allowed maximum (%u)\n",361361+ info->hit_count, XT_RECENT_MAX_NSTAMPS - 1);362362 return -EINVAL;363363 }364364 if (info->name[0] == '\0' ||···587587 add = true;588588 break;589589 default:590590- pr_info("Need \"+ip\", \"-ip\" or \"/\"\n");590590+ pr_info_ratelimited("Need \"+ip\", \"-ip\" or \"/\"\n");591591 return -EINVAL;592592 }593593···601601 succ = in4_pton(c, size, (void *)&addr, '\n', NULL);602602 }603603604604- if (!succ) {605605- pr_info("illegal address written to procfs\n");604604+ if (!succ)606605 return -EINVAL;607607- }608606609607 spin_lock_bh(&recent_lock);610608 e = recent_entry_lookup(t, &addr, family, 0);
···44444545 ret = nf_ct_netns_get(par->net, par->family);4646 if (ret < 0)4747- pr_info("cannot load conntrack support for proto=%u\n",4848- par->family);4747+ pr_info_ratelimited("cannot load conntrack support for proto=%u\n",4848+ par->family);4949 return ret;5050}5151
+3-3
net/netfilter/xt_time.c
···235235236236 if (info->daytime_start > XT_TIME_MAX_DAYTIME ||237237 info->daytime_stop > XT_TIME_MAX_DAYTIME) {238238- pr_info("invalid argument - start or "239239- "stop time greater than 23:59:59\n");238238+ pr_info_ratelimited("invalid argument - start or stop time greater than 23:59:59\n");240239 return -EDOM;241240 }242241243242 if (info->flags & ~XT_TIME_ALL_FLAGS) {244244- pr_info("unknown flags 0x%x\n", info->flags & ~XT_TIME_ALL_FLAGS);243243+ pr_info_ratelimited("unknown flags 0x%x\n",244244+ info->flags & ~XT_TIME_ALL_FLAGS);245245 return -EINVAL;246246 }247247