Skip to content
  • danborkmann@iogearbox.net's avatar
    af_packet: remove BUG statement in tpacket_destruct_skb · 7f5c3e3a
    danborkmann@iogearbox.net authored
    Here's a quote of the comment about the BUG macro from asm-generic/bug.h:
    
     Don't use BUG() or BUG_ON() unless there's really no way out; one
     example might be detecting data structure corruption in the middle
     of an operation that can't be backed out of.  If the (sub)system
     can somehow continue operating, perhaps with reduced functionality,
     it's probably not BUG-worthy.
    
     If you're tempted to BUG(), think again:  is completely giving up
     really the *only* solution?  There are usually better options, where
     users don't need to reboot ASAP and can mostly shut down cleanly.
    
    In our case, the status flag of a ring buffer slot is managed from both sides,
    the kernel space and the user space. This means that even though the kernel
    side might work as expected, the user space screws up and changes this flag
    right between the send(2) is triggered when the flag is changed to
    TP_STATUS_SENDING and a given skb is destructed after some time. Then, this
    will hit...
    7f5c3e3a