diff options
author | Petar Penkov <ppenkov@google.com> | 2019-08-12 16:30:39 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-08-13 16:31:10 +0200 |
commit | 9840a4ffcf0b26e08472ed53d176a6a0f1d4c498 (patch) | |
tree | 5b8fa71c24e314f5c38f7ab7bab4212e30f24ecf /include/vdso | |
parent | d66fa3c70e598746a907e5db5ed024035e01817a (diff) | |
download | linux-9840a4ffcf0b26e08472ed53d176a6a0f1d4c498.tar.gz linux-9840a4ffcf0b26e08472ed53d176a6a0f1d4c498.tar.bz2 linux-9840a4ffcf0b26e08472ed53d176a6a0f1d4c498.zip |
selftests/bpf: fix race in flow dissector tests
Since the "last_dissection" map holds only the flow keys for the most
recent packet, there is a small race in the skb-less flow dissector
tests if a new packet comes between transmitting the test packet, and
reading its keys from the map. If this happens, the test packet keys
will be overwritten and the test will fail.
Changing the "last_dissection" map to a hash map, keyed on the
source/dest port pair resolves this issue. Additionally, let's clear the
last test results from the map between tests to prevent previous test
cases from interfering with the following test cases.
Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode")
Signed-off-by: Petar Penkov <ppenkov@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/vdso')
0 files changed, 0 insertions, 0 deletions