netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: properly initialize xt_table_info structure
@ 2018-05-17  8:44 Greg Kroah-Hartman
  2018-05-17  8:59 ` Michal Kubecek
  0 siblings, 1 reply; 19+ messages in thread
From: Greg Kroah-Hartman @ 2018-05-17  8:44 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal
  Cc: netfilter-devel, coreteam, netdev

When allocating a xt_table_info structure, we should be clearing out the
full amount of memory that was allocated, not just the "header" of the
structure.  Otherwise odd values could be passed to userspace, which is
not a good thing.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/netfilter/x_tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index cb7cb300c3bc..a300e8252bb6 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -1187,7 +1187,7 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size)
 	if (!info)
 		return NULL;
 
-	memset(info, 0, sizeof(*info));
+	memset(info, 0, sz);
 	info->size = size;
 	return info;
 }
-- 
2.17.0

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

end of thread, other threads:[~2018-05-31 16:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17  8:44 [PATCH] netfilter: properly initialize xt_table_info structure Greg Kroah-Hartman
2018-05-17  8:59 ` Michal Kubecek
2018-05-17  9:29   ` Greg Kroah-Hartman
2018-05-17  9:34   ` [PATCH v2] " Greg Kroah-Hartman
2018-05-17  9:55     ` Eric Dumazet
2018-05-17 10:09       ` Greg Kroah-Hartman
2018-05-17 10:42         ` Jan Engelhardt
2018-05-17 13:20           ` Greg Kroah-Hartman
2018-05-18  9:27             ` Florian Westphal
2018-05-18 11:04               ` Greg Kroah-Hartman
2018-05-26 14:54               ` Greg Kroah-Hartman
     [not found]                 ` <CANZU63WyNL4qUJx2eS3gokPMBJLn5=C4-bnOSEF5trX3jGngUA@mail.gmail.com>
2018-05-31  8:24                   ` Florian Westphal
2018-05-31  8:51                     ` Greg Kroah-Hartman
2018-05-31  9:07                       ` Florian Westphal
2018-05-31 10:11                         ` Greg Kroah-Hartman
     [not found]                       ` <CANZU63VE7fWNL+PJrLp7-5PBS6R6RQPvhw2QgqAK8NhX4uQc9Q@mail.gmail.com>
2018-05-31 11:23                         ` Greg Kroah-Hartman
2018-05-31 11:32                         ` Michal Kubecek
2018-05-31 11:55                           ` Michal Kubecek
2018-05-31 16:25                             ` Greg Kroah-Hartman

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).