Skip to content
Snippets Groups Projects
Commit 69139d29 authored by Cong Wang's avatar Cong Wang Committed by Paolo Abeni
Browse files

vsock: fix recursive ->recvmsg calls


After a vsock socket has been added to a BPF sockmap, its prot->recvmsg
has been replaced with vsock_bpf_recvmsg(). Thus the following
recursiion could happen:

vsock_bpf_recvmsg()
 -> __vsock_recvmsg()
  -> vsock_connectible_recvmsg()
   -> prot->recvmsg()
    -> vsock_bpf_recvmsg() again

We need to fix it by calling the original ->recvmsg() without any BPF
sockmap logic in __vsock_recvmsg().

Fixes: 634f1a71 ("vsock: support sockmap")
Reported-by: default avatar <syzbot+bdb4bd87b5e22058e2a4@syzkaller.appspotmail.com>
Tested-by: default avatar <syzbot+bdb4bd87b5e22058e2a4@syzkaller.appspotmail.com>
Cc: Bobby Eshleman <bobby.eshleman@bytedance.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarCong Wang <cong.wang@bytedance.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Link: https://patch.msgid.link/20240812022153.86512-1-xiyou.wangcong@gmail.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent b2ca1661
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment