• Jon Maloy's avatar
    tipc: fix race between poll() and setsockopt() · 60c25306
    Jon Maloy authored
    Letting tipc_poll() dereference a socket's pointer to struct tipc_group
    entails a race risk, as the group item may be deleted in a concurrent
    tipc_sk_join() or tipc_sk_leave() thread.
    
    We now move the 'open' flag in struct tipc_group to struct tipc_sock,
    and let the former retain only a pointer to the moved field. This will
    eliminate the race risk.
    
    Reported-by: syzbot+799dafde0286795858ac@syzkaller.appspotmail.com
    Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    60c25306
group.h 3.39 KB