From: "David S. Miller" <davem@redhat.com>
To: gianni@ecsc.co.uk
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: mmap packet socket information leak (trivial)
Date: Fri, 07 Jun 2002 02:53:19 -0700 (PDT) [thread overview]
Message-ID: <20020607.025319.111425384.davem@redhat.com> (raw)
In-Reply-To: <1022673535.31102.17.camel@lemsip>
From: Gianni Tedesco <gianni@ecsc.co.uk>
Date: 29 May 2002 12:58:55 +0100
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().
...
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
The following seems simpler and is what I checked into my
tree.
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.539 -> 1.540
# net/packet/af_packet.c 1.9 -> 1.10
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/06/07 davem@nuts.ninka.net 1.540
# AF_PACKET: Clear out packet-mmap pages.
# --------------------------------------------
#
diff -Nru a/net/packet/af_packet.c b/net/packet/af_packet.c
--- a/net/packet/af_packet.c Fri Jun 7 02:53:22 2002
+++ b/net/packet/af_packet.c Fri Jun 7 02:53:22 2002
@@ -1662,7 +1662,7 @@
pg_vec[i] = __get_free_pages(GFP_KERNEL, order);
if (!pg_vec[i])
goto out_free_pgvec;
-
+ memset((void *)(pg_vec[i]), 0, PAGE_SIZE << order);
pend = virt_to_page(pg_vec[i] + (PAGE_SIZE << order) - 1);
for (page = virt_to_page(pg_vec[i]); page <= pend; page++)
SetPageReserved(page);
prev parent reply other threads:[~2002-06-07 9:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-29 11:58 [PATCH]: mmap packet socket information leak (trivial) Gianni Tedesco
2002-06-07 9:53 ` David S. Miller [this message]
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=20020607.025319.111425384.davem@redhat.com \
--to=davem@redhat.com \
--cc=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