Thread (1 message) 1 message, 1 author, 2018-12-05

Re: [PATCH net 2/2] neighbour: BUG_ON() writing before skb->head in neigh_hh_output()

From: Stefano Brivio <hidden>
Date: 2018-12-05 00:38:56

On Tue, 4 Dec 2018 16:26:05 -0800
Eric Dumazet [off-list ref] wrote:
quoted
+       /* skb_push() won't panic if we have room for the unaligned size
only */
+       BUG_ON(skb_headroom(skb) < hh_alen);
 
What about avoiding the panic and instead call kfree_skb() ?

         if (WARN_ON_ONCE(skb_headroom(skb) < hh_alen)) {
              kfree_skb(skb);
             return NET_XMIT_DROP;
        }
Okay, I guess it won't go unnoticed anyway, and it's probably better
than the alternative.
quoted
+
        skb_push(skb, hh_len);
 
Maybe we can use __skb_push() here, since prior safety check should be
enough ?
Indeed, I'll change that in v2. Thanks!

-- 
Stefano
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help