[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-JVK0ouOpyUDRJ6HJyiCvas5hmLV-FqiXboADwraC8UZA@mail.gmail.com>
Date: Wed, 4 Jan 2017 09:27:06 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Sowmini Varadhan <sowmini.varadhan@...cle.com>
Cc: linux-kselftest@...r.kernel.org,
Network Development <netdev@...r.kernel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Willem de Bruijn <willemb@...gle.com>,
David Miller <davem@...emloft.net>, shuah@...nel.org
Subject: Re: [PATCH net-next 1/2] tools: psock_lib: tighten conditions checked
in sock_setfilter
On Tue, Jan 3, 2017 at 6:27 PM, Sowmini Varadhan
<sowmini.varadhan@...cle.com> wrote:
> The bpf_prog used in sock_setfilter() only attempts to check for
> ip pktlen, and verifies that the contents of the 80'th packet in
80th byte.
> the ethernet frame is 'a' or 'b'. Offsets used for checking these
> conditions are incorrectly computed.
That's a bit strong. It's not incorrect, in that it just intended to
match the packets as generated by the test -- which it does.
> Thus many non-udp packets
> could incorrectly pass through this filter and cause the test to
> fail.
Absolutely. The test has many potential false positives. Thanks
for hardening it.
I run these kinds of tests in network namespaces to rule out
such flakiness from background traffic.
> This commit tightens the conditions checked by the filter so
> that only UDP/IPv4 packets with the matching length and test-character
> will be permitted by the filter. The filter has been cleaned up
> to explicitly use the BPF macros to make it more readable.
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@...cle.com>
The few comments about the commit wording are no reason for a v2.
Thanks for improving the test.
Acked-by: Willem de Bruijn <willemb@...gle.com>
Powered by blists - more mailing lists