Skip to contentSkip to conversation

netfilter: nftables: fix a warning message in nf_tables_commit_audit_collect()

PATCH Applied Dan Carpenter 4 participants 4 messages Apr 2, 2021 – Apr 15, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nftables: fix a warning message in nf_tables_commit_audit_collect()

The first argument of a WARN_ONCE() is a condition. This WARN_ONCE() will only print the table name, and is potentially problematic if the table name has a %s in it.

Fixes bb4052e57b5b ("audit: log nftables configuration change events once per table")
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +1 -1
index 42bf3e15065a..2fb2ccf87011 100644
@@ -8022,7 +8022,7 @@ static void nf_tables_commit_audit_collect(struct list_head *adl,
 		if (adp->table == table)
 			goto found;
 	}
-	WARN_ONCE("table=%s not expected in commit list", table->name);
+	WARN_ONCE(1, "table=%s not expected in commit list", table->name);
 	return;
 found:
 	adp->entries++;
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dan Carpenter

The first argument of a WARN_ONCE() is a condition. This WARN_ONCE() will only print the table name, and is potentially problematic if the table name has a %s in it.

Fixes bb4052e57b5b ("audit: log nftables configuration change events once per table")
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks Dan.

Quoted 15 lines
net/netfilter/nf_tables_api.c +1 -2
index 42bf3e15065a..2fb2ccf87011 100644
@@ -8022,7 +8022,7 @@ static void nf_tables_commit_audit_collect(struct list_head *adl,
                if (adp->table == table)
                        goto found;
        }
-       WARN_ONCE("table=%s not expected in commit list", table->name);
+       WARN_ONCE(1, "table=%s not expected in commit list", table->name);
        return;
 found:
        adp->entries++;
--

2.30.2

Signature · 2 lines
paul moore
www.paul-moore.com
maintainer Applied
#2 lore raw
Quoted 11 lines · Paul Moore
Quoted 9 lines · Dan Carpenter

The first argument of a WARN_ONCE() is a condition. This WARN_ONCE() will only print the table name, and is potentially problematic if the table name has a %s in it.

Fixes bb4052e57b5b ("audit: log nftables configuration change events once per table")
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines

Thanks Dan.

Applied, thanks.

#3 lore raw
Quoted 12 lines · Pablo Neira Ayuso
Quoted 11 lines · Paul Moore
Quoted 9 lines · Dan Carpenter

The first argument of a WARN_ONCE() is a condition. This WARN_ONCE() will only print the table name, and is potentially problematic if the table name has a %s in it.

Fixes bb4052e57b5b ("audit: log nftables configuration change events once per table")
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines
Quoted 3 lines

Thanks Dan.

Applied, thanks.

Thanks Dan, Paul, Pablo.

- RGB

--
Richard Guy Briggs <[email protected]>
Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635