lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 12 Jun 2015 19:40:45 -0700
From:	Tom Herbert <tom@...bertland.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Alexei Starovoitov <alexei.starovoitov@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Linux Kernel Network Developers <netdev@...r.kernel.org>,
	dan.carpenter@...cle.com
Subject: Re: [PATCH net-next] flow_dissector: fix ipv6 dst, hop-by-hop and
 routing ext hdrs

On Fri, Jun 12, 2015 at 7:31 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> __skb_header_pointer() returns a pointer that must be checked.
>
> Fixes infinite loop reported by Alexei, and add __must_check to
> catch these errors earlier.
>
> Fixes: 6a74fcf426f5 ("flow_dissector: add support for dst, hop-by-hop and routing ext hdrs")
> Reported-by: Alexei Starovoitov <alexei.starovoitov@...il.com>
> Tested-by: Alexei Starovoitov <alexei.starovoitov@...il.com>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> ---
>  include/linux/skbuff.h    |    9 +++++----
>  net/core/flow_dissector.c |    6 ++++--
>  2 files changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index cc612fc0a8943ec853b92e6b3516b0e5582299e2..a7acc92aa6685d7006077510697e3d9481b02588 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -2743,8 +2743,9 @@ __wsum __skb_checksum(const struct sk_buff *skb, int offset, int len,
>  __wsum skb_checksum(const struct sk_buff *skb, int offset, int len,
>                     __wsum csum);
>
> -static inline void *__skb_header_pointer(const struct sk_buff *skb, int offset,
> -                                        int len, void *data, int hlen, void *buffer)
> +static inline void * __must_check
> +__skb_header_pointer(const struct sk_buff *skb, int offset,
> +                    int len, void *data, int hlen, void *buffer)
>  {
>         if (hlen - offset >= len)
>                 return data + offset;
> @@ -2756,8 +2757,8 @@ static inline void *__skb_header_pointer(const struct sk_buff *skb, int offset,
>         return buffer;
>  }
>
> -static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
> -                                      int len, void *buffer)
> +static inline void * __must_check
> +skb_header_pointer(const struct sk_buff *skb, int offset, int len, void *buffer)
>  {
>         return __skb_header_pointer(skb, offset, len, skb->data,
>                                     skb_headlen(skb), buffer);
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 22e4dffa0c8b3b9a20a7324eae1627313e14ce30..476e5dda59e19822dba98a931369ff2666c59c0d 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -394,9 +394,11 @@ ip_proto_again:
>
>                 opthdr = __skb_header_pointer(skb, nhoff, sizeof(_opthdr),
>                                               data, hlen, &_opthdr);
> +               if (!opthdr)
> +                       return false;
>
> -               ip_proto = _opthdr[0];
> -               nhoff += (_opthdr[1] + 1) << 3;
> +               ip_proto = opthdr[0];
> +               nhoff += (opthdr[1] + 1) << 3;
>
>                 goto ip_proto_again;
>         }
>
>

Acked-by: Tom Herbert <tom@...bertland.com>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ