v1->v2: fix one UAF issue, and add some tests. patch1: Add new BPF_F_PERMANENTLY flag for bpf_msg_redirect_map/bpf_msg_redirect_hash patch2-patch7: Added some normal and abnormal use cases. Liu Jian (7): bpf, sockmap: add BPF_F_PERMANENTLY flag for skmsg redirect selftests/bpf: Add txmsg ingress permanently test for sockmap selftests/bpf: Add txmsg redir permanently test for sockmap selftests/bpf: add skmsg verdict tests selftests/bpf: add two skmsg verdict tests for BPF_F_PERMANENTLY flag selftests/bpf: add tests for verdict skmsg to itself selftests/bpf: add tests for verdict skmsg to closed socket include/linux/skmsg.h | 1 + include/uapi/linux/bpf.h | 7 +- net/core/skmsg.c | 1 + net/core/sock_map.c | 4 +- net/ipv4/tcp_bpf.c | 21 ++- tools/include/uapi/linux/bpf.h | 7 +- .../selftests/bpf/prog_tests/sockmap_basic.c | 122 ++++++++++++++++++ .../selftests/bpf/progs/test_sockmap_kern.h | 4 +- .../bpf/progs/test_sockmap_msg_verdict.c | 25 ++++ tools/testing/selftests/bpf/test_sockmap.c | 41 +++++- 10 files changed, 217 insertions(+), 16 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/test_sockmap_msg_verdict.c -- 2.34.1