• Eric Dumazet's avatar
    net: Fix IP_MULTICAST_IF · 55b80503
    Eric Dumazet authored
    ipv4/ipv6 setsockopt(IP_MULTICAST_IF) have dubious __dev_get_by_index() calls.
    
    This function should be called only with RTNL or dev_base_lock held, or reader
    could see a corrupt hash chain and eventually enter an endless loop.
    
    Fix is to call dev_get_by_index()/dev_put().
    
    If this happens to be performance critical, we could define a new dev_exist_by_index()
    function to avoid touching dev refcount.
    Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    55b80503
ipv6_sockglue.c 25.6 KB