Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue
From: Eric Dumazet <hidden>
Date: 2017-06-01 20:50:51
From: Eric Dumazet <hidden>
Date: 2017-06-01 20:50:51
On Thu, 2017-06-01 at 22:35 +0200, Paolo Abeni wrote:
To make the code robust we would have to NULL all the other fields (nfct, nf_bridge, destructor, sk) that are currently not cleared in skb_release_head_state(), elsewhere if one day, after some change, any that fields become non-NULL in this code path we risk a double-free after skb_release_head_state(), even if the code looks safe.
Well, one can not predict future bugs, and we should not add code just trying to prevent future bugs.
Will that be a little too invasive for this small use-case? Can't we prefer a new helper or simply a secpath_reset() plus some appropriate comments?
Please reuse existing functions, and amend them if needed. Fact that we mention secpath_put() or secpath_reset() in an UDP patch should really tell us something is wrong. This is becoming a maintenance burden.