Search Linux Wireless

Re: [PATCH] wireless: drop invalid mesh address extension frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-10-25 at 13:14 -0700, Javier Cardona wrote:

> > @@ -373,6 +370,11 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
> >                         /* make sure meshdr->flags is on the linear part */
> >                         if (!pskb_may_pull(skb, hdrlen + 1))
> >                                 return -1;
> > +                       /* reserved */
> > +                       if ((meshdr->flags & MESH_FLAGS_AE) ==
> > +                                               (MESH_FLAGS_AE_A4 |
> > +                                                MESH_FLAGS_AE_A5_A6))
> > +                               return -1;
> 
> You can filter more aggressively:  If we are here we know that it is a
> unicast data frame  (because FromDS == ToDS == 1).  In that case, the
> only valid address extension modes are 0 or MESH_FLAGS_AE_A5_A6 (see
> Table 8-14). IOW, you could do:
> 
> > +                       if ((meshdr->flags & MESH_FLAGS_AE_A4)))
> > +                                   return -1

Ok.

> > @@ -397,6 +399,11 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
> >                         /* make sure meshdr->flags is on the linear part */
> >                         if (!pskb_may_pull(skb, hdrlen + 1))
> >                                 return -1;
> > +                       /* reserved */
> > +                       if ((meshdr->flags & MESH_FLAGS_AE) ==
> > +                                               (MESH_FLAGS_AE_A4 |
> > +                                                MESH_FLAGS_AE_A5_A6))
> > +                               return -1;
> 
> And a similar comment here: only valid address extension modes are 0
> or MESH_FLAGS_AE_A4, i.e.
> 
> > +                       if ((meshdr->flags & MESH_FLAGS_AE_A5_A6)))
> > +                                   return -1

Ok good, I'll make these changes, makes the code formatting nicer too :)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux