• Cong Wang's avatar
    tipc: check tsk->group in tipc_wait_for_cond() · 143ece65
    Cong Wang authored
    tipc_wait_for_cond() drops socket lock before going to sleep,
    but tsk->group could be freed right after that release_sock().
    So we have to re-check and reload tsk->group after it wakes up.
    
    After this patch, tipc_wait_for_cond() returns -ERESTARTSYS when
    tsk->group is NULL, instead of continuing with the assumption of
    a non-NULL tsk->group.
    
    (It looks like 'dsts' should be re-checked and reloaded too, but
    it is a different bug.)
    
    Similar for tipc_send_group_unicast() and tipc_send_group_anycast().
    
    Reported-by: syzbot+10a9db47c3a0e13eb31c@syzkaller.appspotmail.com
    Fixes: b7d42635 ("tipc: introduce flow control for group broadcast messages")
    Fixes: ee106d7f ("tipc: introduce group anycast messaging")
    Fixes: 27bd9ec0 ("tipc: introduce group unicast messaging")
    Cc: Ying Xue <ying.xue@windriver.com>
    Cc: Jon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
    Acked-by: default avatarYing Xue <ying.xue@windriver.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    143ece65
socket.c 91.2 KB