sys/linux: update BPF_MAP_UPDATE_ELEM to enable more thorough sockmap fuzzing

sockmap and sockhash expect the value of the update syscall to be a file
descriptor for a UDP or TCP socket. Add this knowledge by introducing a
separate union for map update values.
This commit is contained in:
Lorenz Bauer 2020-06-11 12:00:40 +01:00 committed by Dmitry Vyukov
parent 954e0f8699
commit 6dd6b37bc7

View File

@ -96,10 +96,18 @@ bpf_map_lookup_arg {
flags flags[bpf_lookup_flags, int64]
}
bpf_map_update_val [
buf array[int8]
udp sock_udp
udp6 sock_udp6
tcp sock_tcp
tcp6 sock_tcp6
] [varlen]
bpf_map_update_arg {
map fd_bpf_map
key ptr64[in, array[int8]]
val ptr64[in, array[int8]]
val ptr64[in, bpf_map_update_val]
flags flags[bpf_map_flags, int64]
}