netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Neil Horman <nhorman@tuxdriver.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	netdev <netdev@vger.kernel.org>, Guy Harris <guy@alum.mit.edu>
Subject: Re: [PATCH v1 net] packet: handle too big packets for PACKET_V3
Date: Mon, 18 Aug 2014 17:39:02 +0200	[thread overview]
Message-ID: <53F21E16.1090706@redhat.com> (raw)
In-Reply-To: <1408119364.6804.89.camel@edumazet-glaptop2.roam.corp.google.com>

On 08/15/2014 06:16 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> af_packet can currently overwrite kernel memory by out of bound
> accesses, because it assumed a [new] block can always hold one frame.
>
> This is not generally the case, even if most existing tools do it right.
>
> This patch clamps too long frames as API permits, and issue a one time
> error on syslog.
>
> [  394.357639] tpacket_rcv: packet too big, clamped from 5042 to 3966. macoff=82
>
> In this example, packet header tp_snaplen was set to 3966,
> and tp_len was set to 5042 (skb->len)
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Fixes: f6fb8f100b80 ("af-packet: TPACKET_V3 flexible buffer implementation.")

Acked-by: Daniel Borkmann <dborkman@redhat.com>

This looks good to me, thanks Eric!

[ Truly dislike the TPACKET_V3 code ... :/ ]

  reply	other threads:[~2014-08-18 15:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15  0:09 [RFC] packet: handle too big packets for PACKET_V3 Eric Dumazet
2014-08-15  0:36 ` Neil Horman
2014-08-15  0:43 ` Hannes Frederic Sowa
2014-08-15  0:50   ` Hannes Frederic Sowa
2014-08-15  0:56     ` Eric Dumazet
2014-08-15 10:19       ` Neil Horman
2014-08-15  0:54   ` Eric Dumazet
2014-08-15  1:04     ` Hannes Frederic Sowa
2014-08-15  2:01       ` Eric Dumazet
2014-08-15  2:08         ` Hannes Frederic Sowa
2014-08-15  5:02         ` Guy Harris
2014-08-15 16:00           ` Eric Dumazet
2014-08-15 16:16           ` [PATCH v1 net] " Eric Dumazet
2014-08-18 15:39             ` Daniel Borkmann [this message]
2014-08-18 17:08             ` Neil Horman
2014-08-21 23:45             ` David Miller
2014-08-15  4:54       ` [RFC] " Guy Harris
2014-08-15 11:37         ` Hannes Frederic Sowa

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=53F21E16.1090706@redhat.com \
    --to=dborkman@redhat.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=guy@alum.mit.edu \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /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).