[PATCH]: mmap packet socket information leak (trivial)

From: Gianni Tedesco (gianni@ecsc.co.uk)
Date: Wed May 29 2002 - 06:58:55 EST


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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri May 31 2002 - 22:00:25 EST