[ovs-dev] [PATCH] datapath: compat: vxlan: Avoid possible NULL dereference in vxlan_gro_receive.

张东亚 fortitude.zhang at gmail.com
Mon Nov 14 05:42:54 UTC 2016


Hi,

Maybe it's caused by I manually copy patch to web gmail, thanks a lot for
merging that.


2016-11-14 12:49 GMT+08:00 Pravin Shelar <pshelar at ovn.org>:

> On Sun, Nov 13, 2016 at 6:59 PM, 张东亚 <fortitude.zhang at gmail.com> wrote:
> > With Linux kernel that does not have HAVE_UDP_OFFLOAD_ARG_UOFF macro
> > detected,
> > struct vxlan_sock *vs will be NULL, which will make kernel crash when
> > receiving
> > VXLAN packet that have RCO flag turn on or even invalid packet that is
> > destined
> > to VXLAN port which have the bit on in the RCO flag position.
> >
> > Signed-off-by: Zhang Dongya <fortitude.zhang at gmail.com>
> > ---
> >  datapath/linux/compat/vxlan.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/datapath/linux/compat/vxlan.c
> b/datapath/linux/compat/vxlan.c
> > index d5dbe8d..3abcab1 100644
> > --- a/datapath/linux/compat/vxlan.c
> > +++ b/datapath/linux/compat/vxlan.c
> > @@ -320,7 +320,7 @@ static struct sk_buff **vxlan_gro_receive(struct
> > sk_buff **head,
> >
> >   flags = vh->vx_flags;
> >
> > - if ((flags & VXLAN_HF_RCO) && (vs->flags & VXLAN_F_REMCSUM_RX)) {
> > + if ((flags & VXLAN_HF_RCO) && vs && (vs->flags & VXLAN_F_REMCSUM_RX)) {
> >   vh = vxlan_gro_remcsum(skb, off_vx, vh, sizeof(struct vxlanhdr),
> >         vh->vx_vni, &grc,
> >         !!(vs->flags &
> > --
>
> I could not apply this patch due to white space error. But it is
> trivial patch so I manually applied it to master and branch-2.6.
>


More information about the dev mailing list