]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: check NULL for sk_to_full_sk() return value
authorWANG Cong <xiyou.wangcong@gmail.com>
Mon, 17 Jul 2017 18:42:55 +0000 (11:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jul 2017 20:37:56 +0000 (13:37 -0700)
commit8d42702e1ff93fddc6592f1ad56422942ad30ae6
treede50c6c9a402363e37350b62dc136a7818265397
parentec44a27f9f0edb2f807c9a0ca3ba4f86852a16c6
bpf: check NULL for sk_to_full_sk() return value

When req->rsk_listener is NULL, sk_to_full_sk() returns
NULL too, so we have to check its return value against
NULL here.

Fixes: 3e7b25e0cae5 ("bpf: BPF support for sock_ops")
Reported-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: Lawrence Brakmo <brakmo@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf-cgroup.h