RE: [PATCH] netfilter/nflog: nflog-range does not truncate packets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vish, Pablo,

I wonder about the value of sending more data than a client is willing to consume (setting aside the important fact that the client code crashes due to the extra data).

It seems that we should either drop the nflog-range parameter from nflog altogether (and just use the len from the client) or allow nflog-range to further *restrict* the number of bytes sent to the client.

The "further restrict" logic would make it easier to build iptables rules that vary nflog-range based on some match conditions, so a single client would get different packet length depending on what rules matched.

Thoughts?

- Igor


-----Original Message-----
From: Vishwanath Pai [mailto:vpai@xxxxxxxxxx] 
Sent: Wednesday, June 15, 2016 10:55 AM
To: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Cc: kaber@xxxxxxxxx; kadlec@xxxxxxxxxxxxxxxxx; netfilter-devel@xxxxxxxxxxxxxxx; coreteam@xxxxxxxxxxxxx; Hunt, Joshua <johunt@xxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; pai.vishwain@xxxxxxxxx; Lubashev, Igor <ilubashe@xxxxxxxxxx>
Subject: Re: [PATCH] netfilter/nflog: nflog-range does not truncate packets

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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux