[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKznSPH9VogQEPSw4bLL8F_L_qj2ZY2M==VZ-O1u0xqiA@mail.gmail.com>
Date: Thu, 1 Jun 2017 09:40:55 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
netdev <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH net-next 2/3] udp: avoid a cache miss on dequeue
On Thu, Jun 1, 2017 at 9:21 AM, Paolo Abeni <pabeni@...hat.com> wrote:
> I'm sorry, I do not follow. I'm concerned about the secpath field (skb-
>>sp), which is the only one that can be not NULL in
> __udp_queue_rcv_skb().
>
> If the secpath is not NULL, calling there secpath_reset() (or the to-
> be-introduced skb_reset_head_state()), we will properly release it and
> we will clear the field, too.
>
> Calling skb_release_head_state() in the same scenario, we release the
> secpath, but we don't clear it. So if the packet is later dropped we
> will get a double free, unless we add and use a specialized a
> free_stateless_skb(), too.
Then simply use secpath_reset() instead of secpath_put() from
skb_release_head_state()
Clearly having these subtle differences bring confusion, for very little gain.
secpath_put() should be removed. Most of its callers simply set
skb->sp back to NULL anyway.
Powered by blists - more mailing lists