All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_match()
@ 2018-01-24 22:49 Eric Dumazet
  2018-01-24 23:19 ` Florian Westphal
  2018-01-24 23:49 ` [PATCH net] netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_match() Pablo Neira Ayuso
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Dumazet @ 2018-01-24 22:49 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netdev, netfilter-devel, Florian Westphal

From: Eric Dumazet <edumazet@google.com>

It looks like syzbot found its way into netfilter territory.

Issue here is that @name comes from user space and might
not be null terminated.

Out-of-bound reads happen, KASAN is not happy.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
---
No Fixes: tag, bug seems to be a day-0 one.

diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 55802e97f906d1987ed78b4296584deb38e5f876..8516dc459b539342f44d2b2b3e21b140677c7826 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -210,6 +210,9 @@ xt_request_find_match(uint8_t nfproto, const char *name, uint8_t revision)
 {
 	struct xt_match *match;
 
+	if (strnlen(name, XT_EXTENSION_MAXNAMELEN) == XT_EXTENSION_MAXNAMELEN)
+		return ERR_PTR(-EINVAL);
+
 	match = xt_find_match(nfproto, name, revision);
 	if (IS_ERR(match)) {
 		request_module("%st_%s", xt_prefix[nfproto], name);


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

end of thread, other threads:[~2018-01-25 11:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24 22:49 [PATCH net] netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_match() Eric Dumazet
2018-01-24 23:19 ` Florian Westphal
2018-01-24 23:50   ` Pablo Neira Ayuso
2018-01-25  0:13     ` Pablo Neira Ayuso
2018-01-25  1:13       ` Eric Dumazet
2018-01-25  1:16       ` [PATCH v2 net] netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target} Eric Dumazet
2018-01-25  6:09         ` Florian Westphal
2018-01-25 11:33         ` Pablo Neira Ayuso
2018-01-24 23:49 ` [PATCH net] netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_match() Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.