OSDN Git Service

unix_bpf: Fix a potential deadlock in unix_dgram_bpf_recvmsg()
authorCong Wang <cong.wang@bytedance.com>
Fri, 23 Jul 2021 18:36:30 +0000 (11:36 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 30 Jul 2021 19:40:55 +0000 (12:40 -0700)
commit0b846445985895e75958ecd59061fd7bf77e0c3f
tree47178f8be372abbc3a48077329f45c5cfaf2fc5a
parenta710eed386f182fcbfe517b659f60024fdb7c40c
unix_bpf: Fix a potential deadlock in unix_dgram_bpf_recvmsg()

As Eric noticed, __unix_dgram_recvmsg() may acquire u->iolock
too, so we have to release it before calling this function.

Fixes: 9825d866ce0d ("af_unix: Implement unix_dgram_bpf_recvmsg()")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
net/unix/unix_bpf.c