summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net/Makefile
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2018-11-24 21:09:26 -0500
committerDavid S. Miller <davem@davemloft.net>2018-11-24 18:22:21 -0800
commit358be656406dce296fafeac7a913ba33e9a66971 (patch)
tree11dcd5c0e1ebe476284d310dd60299be0ef5fae8 /tools/testing/selftests/net/Makefile
parent3c18aa1464f9232d6abac8d7b4540f61b0658d62 (diff)
downloadblackbird-obmc-linux-358be656406dce296fafeac7a913ba33e9a66971.tar.gz
blackbird-obmc-linux-358be656406dce296fafeac7a913ba33e9a66971.zip
selftests/net: add txring_overwrite
Packet sockets with PACKET_TX_RING send skbs with user data in frags. Before commit 5cd8d46ea156 ("packet: copy user buffers before orphan or clone") ring slots could be released prematurely, possibly allowing a process to overwrite data still in flight. This test opens two packet sockets, one to send and one to read. The sender has a tx ring of one slot. It sends two packets with different payload, then reads both and verifies their payload. Before the above commit, both receive calls return the same data as the send calls use the same buffer. From the commit, the clone needed for looping onto a packet socket triggers an skb_copy_ubufs to create a private copy. The separate sends each arrive correctly. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/net/Makefile')
-rw-r--r--tools/testing/selftests/net/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index eec359895feb..7aebbcaa91bf 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -11,7 +11,7 @@ TEST_PROGS += udpgro_bench.sh udpgro.sh
TEST_PROGS_EXTENDED := in_netns.sh
TEST_GEN_FILES = socket
TEST_GEN_FILES += psock_fanout psock_tpacket msg_zerocopy
-TEST_GEN_FILES += tcp_mmap tcp_inq psock_snd
+TEST_GEN_FILES += tcp_mmap tcp_inq psock_snd txring_overwrite
TEST_GEN_FILES += udpgso udpgso_bench_tx udpgso_bench_rx ip_defrag
TEST_GEN_PROGS = reuseport_bpf reuseport_bpf_cpu reuseport_bpf_numa
TEST_GEN_PROGS += reuseport_dualstack reuseaddr_conflict tls
OpenPOWER on IntegriCloud