From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
sowmini.varadhan@oracle.com
Cc: daniel@iogearbox.net, willemb@google.com, davem@davemloft.net,
shuah@kernel.org
Subject: [PATCH v3 net-next 0/2] tools: psock_tpacket bug fixes
Date: Wed, 4 Jan 2017 10:45:47 -0800 [thread overview]
Message-ID: <cover.1483555162.git.sowmini.varadhan@oracle.com> (raw)
This patchset includes fixes to psock_tpacket for false-negatives
sporadically reported by the test when it was run concurrently with
other heavy network traffic (e.g., over an ssh session, as opposed
to running the test from the console of the test machine). The
test sometimes failed with errors reporting more recvd packets than
expected (e.g., "walk_v0_rx: received 201 out of 100 pkts") or
the reception of non-IP packets (e.g., ARP packets).
There are 2 sources of network interference that can disrupt the test:
1. set_sockfilter() can use some hardening (currently passes up packets
based on ip length field, and payload signature but this may potentially
match other network traffic on the test machine)
2. There is a race-window between packet_create() and packet_do_bind()
in which packets from any interface (e.g., eth0) will get queued
for Rx on the test socket.
Patch 1 fixes the first issue by cleaing up set_sockfilter() and
hardening it to make sure that it only permits UDP/IPv4 packets.
Patch 2 fixes the second issue by making sure we open the PF_PACKET
socket with protocol 0 to reject all packets, and make sure the
BPF filter is set up before binding the socket to ETH_P_ALL and lo.
v2: patch 2 reworked based on review comments.
v3: Shuah Khan nit.
Sowmini Varadhan (2):
tools: psock_lib: tighten conditions checked in sock_setfilter
tools: psock_tpacket: block Rx until socket filter has been added and
socket has been bound to loopback.
tools/testing/selftests/net/psock_lib.h | 29 ++++++++++++++++++++------
tools/testing/selftests/net/psock_tpacket.c | 6 ++--
2 files changed, 25 insertions(+), 10 deletions(-)
next reply other threads:[~2017-01-04 18:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 18:45 Sowmini Varadhan [this message]
2017-01-04 18:45 ` [PATCH v3 net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter Sowmini Varadhan
2017-01-04 22:16 ` Daniel Borkmann
2017-01-04 22:22 ` Sowmini Varadhan
2017-01-04 22:26 ` Daniel Borkmann
2017-01-04 22:48 ` Sowmini Varadhan
2017-01-04 22:59 ` Daniel Borkmann
2017-01-04 22:37 ` Shuah Khan
2017-01-04 22:49 ` Sowmini Varadhan
2017-01-04 22:55 ` Sowmini Varadhan
2017-01-04 23:26 ` Shuah Khan
2017-01-05 15:54 ` Sowmini Varadhan
2017-01-05 18:46 ` Shuah Khan
2017-01-04 18:45 ` [PATCH v3 net-next 2/2] tools: psock_tpacket: block Rx until socket filter has been added and socket has been bound to loopback Sowmini Varadhan
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=cover.1483555162.git.sowmini.varadhan@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=willemb@google.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).