[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpVv+OKb4483TOvdVrVXonLOvw9NAw=WApU5MnHmMdHz7Q@mail.gmail.com>
Date: Mon, 12 Oct 2020 15:26:41 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Xie He <xie.he.0141@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
syzbot <syzbot+4a2c52677a8a1aa283cb@...kaller.appspotmail.com>,
William Tu <u9012063@...il.com>,
Willem de Bruijn <willemdebruijn.kernel@...il.com>
Subject: Re: [Patch net v2] ip_gre: set dev->hard_header_len and
dev->needed_headroom properly
On Sun, Oct 11, 2020 at 3:46 PM Xie He <xie.he.0141@...il.com> wrote:
>
> On Sun, Oct 11, 2020 at 12:11 PM Cong Wang <xiyou.wangcong@...il.com> wrote:
> >
> > @@ -626,8 +626,7 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
> >
> > if (dev->header_ops) {
> > /* Need space for new headers */
> > - if (skb_cow_head(skb, dev->needed_headroom -
> > - (tunnel->hlen + sizeof(struct iphdr))))
> > + if (skb_cow_head(skb, dev->hard_header_len))
> > goto free_skb;
> >
> > tnl_params = (const struct iphdr *)skb->data;
>
> As I understand, the skb_cow functions are for ensuring enough header
> space before skb->data. (Right?) However, at this stage our skb->data
> is already at the outer IP header, I think we don't need to request
> additional header space before the outer IP header.
Good point, I thought skb_headroom() == dev->hard_header_len,
but skb->data already points to the tunnel header like you said, so
we should pass 0 to skb_cow_head() here.
Thanks.
Powered by blists - more mailing lists