bpf: bpf_setsockopt: reset sock dst on SO_MARK changes
authorPeter Oskolkov <posk@google.com>
Wed, 16 Jan 2019 16:47:54 +0000 (08:47 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 17 Jan 2019 23:27:47 +0000 (00:27 +0100)
commitf4924f24da8c7ef64195096817f3cde324091d97
treec59e9d734170a6ff9c5640a9ada341bdf77ec515
parentc61c27687a5abce11431e6de1adb6e36099b9859
bpf: bpf_setsockopt: reset sock dst on SO_MARK changes

In sock_setsockopt() (net/core/sock.h), when SO_MARK option is used
to change sk_mark, sk_dst_reset(sk) is called. The same should be
done in bpf_setsockopt().

Fixes: 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf")
Reported-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Peter Oskolkov <posk@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/filter.c