All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] tools: psock_tpacket bug fixes
@ 2017-01-03 23:27 Sowmini Varadhan
  2017-01-03 23:27 ` [PATCH net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter Sowmini Varadhan
  2017-01-03 23:27 ` [PATCH net-next 2/2] tools: psock_tpacket: verify that packet was received on lo before counting it Sowmini Varadhan
  0 siblings, 2 replies; 12+ messages in thread
From: Sowmini Varadhan @ 2017-01-03 23:27 UTC (permalink / raw)
  To: linux-kselftest, netdev, sowmini.varadhan; +Cc: daniel, willemb, davem, shuah

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 problems with the test:

1. set_sockfilter() has many bugs (e.g. it will allow TCP packets
   that may happen to match on the length field and happen to have
   the 'a' or 'b' at the location tested by the filter). In addition,
   it is very hard to read, making these bugs harder to find.

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. These packets should not be counted
   toward the test.

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 checking the Rx ifindex passed up
with the tpacket rx frame and making sure that packets counted
toward the test are those received on lo.



Sowmini Varadhan (2):
  tools: tighten conditions checked in sock_setfilter
  tools: psock_tpacket: verify that packet was received on lo before
    counting it

 tools/testing/selftests/net/psock_lib.h     |   28 ++++++++++++++++++++------
 tools/testing/selftests/net/psock_tpacket.c |   25 +++++++++++++++++++----
 2 files changed, 41 insertions(+), 12 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-01-04 16:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-03 23:27 [PATCH net-next 0/2] tools: psock_tpacket bug fixes Sowmini Varadhan
2017-01-03 23:27 ` [PATCH net-next 1/2] tools: psock_lib: tighten conditions checked in sock_setfilter Sowmini Varadhan
2017-01-04 14:27   ` Willem de Bruijn
2017-01-03 23:27 ` [PATCH net-next 2/2] tools: psock_tpacket: verify that packet was received on lo before counting it Sowmini Varadhan
2017-01-04 14:30   ` Willem de Bruijn
2017-01-04 14:44     ` Sowmini Varadhan
2017-01-04 15:03       ` Willem de Bruijn
2017-01-04 15:13         ` Sowmini Varadhan
2017-01-04 16:07           ` Willem de Bruijn
2017-01-04 16:12             ` Sowmini Varadhan
2017-01-04 16:24               ` Willem de Bruijn
2017-01-04 16:27                 ` Sowmini Varadhan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.