[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20181205013849.292614d5@redhat.com>
Date: Wed, 5 Dec 2018 01:38:49 +0100
From: Stefano Brivio <sbrivio@...hat.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: David Miller <davem@...emloft.net>, Jianlin Shi <jishi@...hat.com>,
Hangbin Liu <liuhangbin@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net 2/2] neighbour: BUG_ON() writing before skb->head in
neigh_hh_output()
On Tue, 4 Dec 2018 16:26:05 -0800
Eric Dumazet <edumazet@...gle.com> wrote:
> > + /* 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.
> > +
> > 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
Powered by blists - more mailing lists