[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9AAE0902D5BC7E449B7C8E4E778ABCD019BC50@AMSPEX01CL01.citrite.net>
Date: Mon, 2 Dec 2013 09:45:50 +0000
From: Paul Durrant <Paul.Durrant@...rix.com>
To: David Miller <davem@...emloft.net>
CC: "xen-devel@...ts.xen.org" <xen-devel@...ts.xen.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Wei Liu <wei.liu2@...rix.com>,
Ian Campbell <Ian.Campbell@...rix.com>,
David Vrabel <david.vrabel@...rix.com>
Subject: RE: [PATCH net v3] xen-netback: fix fragment detection in checksum
setup
> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: 30 November 2013 21:14
> To: Paul Durrant
> Cc: xen-devel@...ts.xen.org; netdev@...r.kernel.org; Wei Liu; Ian Campbell;
> David Vrabel
> Subject: Re: [PATCH net v3] xen-netback: fix fragment detection in checksum
> setup
>
> From: Paul Durrant <paul.durrant@...rix.com>
> Date: Fri, 29 Nov 2013 10:52:08 +0000
>
> > @@ -1166,15 +1166,27 @@ static int checksum_setup_ip(struct xenvif *vif,
> struct sk_buff *skb,
> > struct iphdr *iph = (void *)skb->data;
> > unsigned int header_size;
> > unsigned int off;
> > + bool fragment;
> > int err = -EPROTO;
> >
> > + fragment = false;
> > +
> > off = sizeof(struct iphdr);
> >
> > header_size = skb->network_header + off + MAX_IPOPTLEN;
> > maybe_pull_tail(skb, header_size);
> >
> > + if (iph->frag_off & htons(IP_OFFSET | IP_MF))
> > + fragment = true;
>
> This function has a serious problem.
>
> maybe_pull_tail() can change skb->data, therefore this "iph" pointer
> can become invalid, you're essentially dereferencing garbage if
> maybe_pull_tail() actually does any work.
Ok. Clearly I'm misunderstanding what __pskb_pull_tail() does then. I was under the impression that it moved skb->tail on but left skb->data alone (which is what I want to do). I will have another look.
>
> Secondly, do you really (even rate limited) want to span the system
> log just because some ipv4 fragmented frames end up here? That
> doesn't make any sense to me. Maybe bump a statistic or something
> like that, but a log message triggerable by a remote entity? No way.
Ok.
Paul
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists