public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gianni Tedesco <gianni@ecsc.co.uk>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH]: mmap packet socket information leak (trivial)
Date: 29 May 2002 12:58:55 +0100	[thread overview]
Message-ID: <1022673535.31102.17.camel@lemsip> (raw)

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


             reply	other threads:[~2002-05-29 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-29 11:58 Gianni Tedesco [this message]
2002-06-07  9:53 ` [PATCH]: mmap packet socket information leak (trivial) David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1022673535.31102.17.camel@lemsip \
    --to=gianni@ecsc.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox