[NETFILTER]: Fix stack leakage in iptables/ip6_tables

Linux Kernel Mailing List <[email protected]>
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1548, 2004/12/21 17:48:24+01:00, [email protected]

	[NETFILTER]: Fix stack leakage in iptables/ip6_tables
	 
	Signed-off-by: Patrick McHardy <[email protected]>



 ipv4/netfilter/ip_tables.c  |    2 +-
 ipv6/netfilter/ip6_tables.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
--- a/net/ipv4/netfilter/ip_tables.c	2005-01-15 07:04:59 -08:00
+++ b/net/ipv4/netfilter/ip_tables.c	2005-01-15 07:04:59 -08:00
@@ -1274,7 +1274,7 @@
 			       sizeof(info.underflow));
 			info.num_entries = t->private->number;
 			info.size = t->private->size;
-			strcpy(info.name, name);
+			memcpy(info.name, name, sizeof(info.name));
 
 			if (copy_to_user(user, &info, *len) != 0)
 				ret = -EFAULT;
diff -Nru a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
--- a/net/ipv6/netfilter/ip6_tables.c	2005-01-15 07:04:59 -08:00
+++ b/net/ipv6/netfilter/ip6_tables.c	2005-01-15 07:04:59 -08:00
@@ -1356,7 +1356,7 @@
 			       sizeof(info.underflow));
 			info.num_entries = t->private->number;
 			info.size = t->private->size;
-			strcpy(info.name, name);
+			memcpy(info.name, name, sizeof(info.name));
 
 			if (copy_to_user(user, &info, *len) != 0)
 				ret = -EFAULT;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.