On Sat, 2017-04-08 at 20:36 +0200, Steffen Klassert wrote:
> All available gso_type flags are currently in use, so
> extend gso_type from 'unsigned short' to 'unsigned int'
> to be able to add further flags.
> 
> We reorder the struct skb_shared_info to use
> two bytes of the four byte hole before dataref.
> All fields before dataref are cleared, i.e.
> four bytes more than before the change.
> 
> The remaining two byte hole is moved to the
> beginning of the structure, this protects us
> from immediate overwites on out of bound writes
> to the sk_buff head.

> Signed-off-by: Steffen Klassert <steffen.klass...@secunet.com>
> ---
>  include/linux/skbuff.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index c776abd..741d75c 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -413,14 +413,15 @@ struct ubuf_info {
>   * the end of the header data, ie. at skb->end.
>   */
>  struct skb_shared_info {
> +     unsigned short  _unused;
>       unsigned char   nr_frags;
>       __u8            tx_flags;
>       unsigned short  gso_size;
>       /* Warning: this field is not always filled in (UFO)! */
>       unsigned short  gso_segs;
> -     unsigned short  gso_type;
>       struct sk_buff  *frag_list;
>       struct skb_shared_hwtstamps hwtstamps;
> +     unsigned int    gso_type;
>       u32             tskey;
>       __be32          ip6_frag_id;
>  

This looks much better, thanks Steffen.

Acked-by: Eric Dumazet <eduma...@google.com>



Reply via email to