• Eric Dumazet's avatar
    packet: avoid panic in packet_getsockopt() · 509c7a1e
    Eric Dumazet authored
    syzkaller got crashes in packet_getsockopt() processing
    PACKET_ROLLOVER_STATS command while another thread was managing
    to change po->rollover
    
    Using RCU will fix this bug. We might later add proper RCU annotations
    for sparse sake.
    
    In v2: I replaced kfree(rollover) in fanout_add() to kfree_rcu()
    variant, as spotted by John.
    
    Fixes: a9b63918 ("packet: rollover statistics")
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Cc: Willem de Bruijn <willemb@google.com>
    Cc: John Sperbeck <jsperbeck@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    509c7a1e
af_packet.c 107 KB