netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vishwanath Pai <vpai@akamai.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: kaber@trash.net, kadlec@blackhole.kfki.hu,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	johunt@akamai.com, netdev@vger.kernel.org,
	pai.vishwain@gmail.com, "Lubashev, Igor" <ilubashe@akamai.com>
Subject: Re: [PATCH] netfilter/nflog: nflog-range does not truncate packets
Date: Wed, 15 Jun 2016 10:55:05 -0400	[thread overview]
Message-ID: <57616C49.7090403@akamai.com> (raw)
In-Reply-To: <20160615123945.GA3594@salvia>

On 06/15/2016 08:39 AM, Pablo Neira Ayuso wrote:
> But nlmsg_len should match len in this.
> 
> If we're just sending a part of the packet to userspace, then we
> should adjust nlmsg_len to indicate exactly the netlink message length
> that we're sending to userspace.
> 
> Is your patch triggering this nlmsg_len != len?

The value of len here is how many bytes were returned by recv. We do
send the entire nlmsg_len to userspace, but recv cannot copy the full
packet because the buffer is not big enough to hold this. They only
allocate the buffer assuming that the packet won't be bigger than their
snap len, but we send more data than their snap len and they don't
handle this condition well.

  reply	other threads:[~2016-06-15 14:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-02  0:23 [PATCH] netfilter/nflog: nflog-range does not truncate packets Vishwanath Pai
2016-06-06 22:31 ` Pablo Neira Ayuso
2016-06-07 23:06   ` Vishwanath Pai
2016-06-08 12:16     ` Pablo Neira Ayuso
2016-06-09 17:57       ` Vishwanath Pai
2016-06-13  3:40         ` Vishwanath Pai
2016-06-15 12:39           ` Pablo Neira Ayuso
2016-06-15 14:55             ` Vishwanath Pai [this message]
2016-06-15 15:13               ` Lubashev, Igor
2016-06-17 11:22                 ` Pablo Neira Ayuso
2016-06-17 15:43                   ` Vishwanath Pai

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=57616C49.7090403@akamai.com \
    --to=vpai@akamai.com \
    --cc=coreteam@netfilter.org \
    --cc=ilubashe@akamai.com \
    --cc=johunt@akamai.com \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=pai.vishwain@gmail.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).