public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: mmap packet socket information leak (trivial)
@ 2002-05-29 11:58 Gianni Tedesco
  2002-06-07  9:53 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Gianni Tedesco @ 2002-05-29 11:58 UTC (permalink / raw)
  To: Linux Kernel

Hi,

Here is a quick patch which blanks the mmap() packet socket buffer areas
before using them. Previously you would get uninitialised data inbetween
the data structures where they are TPACKET_ALIGNED().

The root user could potentially unwittingly save this data to a file and
distribute it not knowing his password was in it or whatever... Not very
likely but its worth fixing IMHO :)

Regards

diff -urN linux.orig/net/packet/af_packet.c linux/net/packet/af_packet.c
--- linux.orig/net/packet/af_packet.c	Wed May 29 12:30:10 2002
+++ linux/net/packet/af_packet.c	Wed May 29 12:29:10 2002
@@ -1679,6 +1679,7 @@
 			int k;
 
 			for (k=0; k<frames_per_block; k++, l++) {
+				memset((void *)ptr, 0, req->tp_frame_size);
 				io_vec[l] = (struct tpacket_hdr*)ptr;
 				io_vec[l]->tp_status = TP_STATUS_KERNEL;
 				ptr += req->tp_frame_size;

-- 
// Gianni Tedesco <gianni@ecsc.co.uk>
8646BE7D: 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D


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

end of thread, other threads:[~2002-06-07  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-29 11:58 [PATCH]: mmap packet socket information leak (trivial) Gianni Tedesco
2002-06-07  9:53 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox