netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] netfilter: nf_tables: set names cannot be larger than 15 bytes
@ 2014-03-31 11:51 Pablo Neira Ayuso
  2014-03-31 11:51 ` [PATCH 2/3] netfilter: nf_tables: fix wrong format in request_module() Pablo Neira Ayuso
  2014-03-31 11:51 ` [PATCH 3/3] netfilter: nf_tables: enforce NLA_NUL_STRING in strings Pablo Neira Ayuso
  0 siblings, 2 replies; 7+ messages in thread
From: Pablo Neira Ayuso @ 2014-03-31 11:51 UTC (permalink / raw)
  To: netfilter-devel; +Cc: fw, kaber

Currently, nf_tables trims off the set name if it exceeeds 15
bytes, so explicitly reject set names that are too large.

Reported-by: Giuseppe Longo <giuseppelng@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nf_tables_api.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 33045a5..43ae487 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1946,7 +1946,8 @@ static const struct nft_set_ops *nft_select_set_ops(const struct nlattr * const
 
 static const struct nla_policy nft_set_policy[NFTA_SET_MAX + 1] = {
 	[NFTA_SET_TABLE]		= { .type = NLA_STRING },
-	[NFTA_SET_NAME]			= { .type = NLA_STRING },
+	[NFTA_SET_NAME]			= { .type = NLA_STRING,
+					    .len = IFNAMSIZ - 1 },
 	[NFTA_SET_FLAGS]		= { .type = NLA_U32 },
 	[NFTA_SET_KEY_TYPE]		= { .type = NLA_U32 },
 	[NFTA_SET_KEY_LEN]		= { .type = NLA_U32 },
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-31 14:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 11:51 [PATCH 1/3] netfilter: nf_tables: set names cannot be larger than 15 bytes Pablo Neira Ayuso
2014-03-31 11:51 ` [PATCH 2/3] netfilter: nf_tables: fix wrong format in request_module() Pablo Neira Ayuso
2014-03-31 11:51 ` [PATCH 3/3] netfilter: nf_tables: enforce NLA_NUL_STRING in strings Pablo Neira Ayuso
2014-03-31 12:15   ` Florian Westphal
2014-03-31 12:46     ` Pablo Neira Ayuso
2014-03-31 13:08       ` Florian Westphal
2014-03-31 14:09         ` Thomas Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).