af_packet: Raw socket destruction warning fix
Subsystems (2)
Hi Daniel,
Quoted 6 lines
The other
sock_put()inpacket_release()to drop the final ref and call intosk_free(), which drops the 1 ref on thesk_wmem_allocfrom init time. Since you got into__sk_free()viasock_wfree()destructor, your socket must have invokedpacket_release()prior to this (perhaps kernel destroying the process).What kernel do you use?
Issue is coming for 3.10.58.
Quoted 7 lines
Quoted 7 lines
Driver calls
dev_kfree_skb_any->dev_kfree_skb_irq
and it adds buffer in completion queue to free and raises softirqNET_TX_SOFTIRQnet_tx_action->__kfree_skb->skb_release_all->skb_release_head_state->sock_wfree->
__sk_free->packet_sock_destructAlso purging of receive queue has been taken care in other protocols.
Quoted 8 lines · Maninder Singh
Quoted 6 lines
The other
sock_put()inpacket_release()to drop the final ref and call intosk_free(), which drops the 1 ref on thesk_wmem_allocfrom init time. Since you got into__sk_free()viasock_wfree()destructor, your socket must have invokedpacket_release()prior to this (perhaps kernel destroying the process).What kernel do you use?
Issue is coming for 3.10.58.
[ sorry for late reply ]
What driver are you using (is that in-tree)? Can you reproduce the same issue with a latest -net kernel, for example (or, a 'reasonably' recent one like 4.3 or 4.4)? There has been quite a bit of changes in err queue handling (which also accounts rmem) as well. How reliably can you trigger the issue? Does it trigger with a completely different in-tree network driver as well with your tests? Would be useful to track/debug sk_rmem_alloc increases/decreases to see from which path new rmem is being charged in the time between packet_release() and packet_sock_destruct() for that socket ...
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Driver calls
dev_kfree_skb_any->dev_kfree_skb_irq
and it adds buffer in completion queue to free and raises softirqNET_TX_SOFTIRQnet_tx_action->__kfree_skb->skb_release_all->skb_release_head_state->sock_wfree->
__sk_free->packet_sock_destructAlso purging of receive queue has been taken care in other protocols.