From: Daniel Borkmann <dborkman@redhat.com>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Atzm Watanabe <atzm@stratosphere.co.jp>,
netdev@vger.kernel.org,
Stephen Hemminger <stephen@networkplumber.org>,
Ben Hutchings <bhutchings@solarflare.com>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH v3 2/3] packet: fill the gap of TPACKET_ALIGNMENT with zeros
Date: Mon, 16 Dec 2013 11:22:35 +0100 [thread overview]
Message-ID: <52AED46B.3090601@redhat.com> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B7491@saturn3.aculab.com>
On 12/16/2013 11:16 AM, David Laight wrote:
>>> + memset(h.h2->tp_padding, 0,
>>> + hdrlen - offsetof(struct tpacket2_hdr, tp_padding));
>
> What is wrong with 'sizeof h.h2->tp_padding' ?
> The compiler will probably inline the memset into a couple of word
> sized writes of zero - probably not measurable.
> Not zeroing them might be leaking kernel memory contents (depends
> where the memory came from - might just be stale packet data).
The ring buffer memory we're operating on comes from mmap(2) btw.
> David
>
>
>
next prev parent reply other threads:[~2013-12-16 10:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-16 8:12 [PATCH v3 2/3] packet: fill the gap of TPACKET_ALIGNMENT with zeros Atzm Watanabe
2013-12-16 10:09 ` Daniel Borkmann
2013-12-16 10:16 ` David Laight
2013-12-16 10:22 ` Daniel Borkmann [this message]
2013-12-16 12:41 ` Atzm Watanabe
2013-12-16 12:55 ` Daniel Borkmann
2013-12-16 16:48 ` Atzm Watanabe
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=52AED46B.3090601@redhat.com \
--to=dborkman@redhat.com \
--cc=David.Laight@ACULAB.COM \
--cc=atzm@stratosphere.co.jp \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).