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: Thu, 22 Feb 2024 09:11:14 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Lizhi Xu <lizhi.xu@...driver.com>
Cc: syzbot+99d15fcdb0132a1e1a82@...kaller.appspotmail.com, davem@...emloft.net, 
	dsahern@...nel.org, fw@...len.de, horms@...nel.org, kuba@...nel.org, 
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org, pabeni@...hat.com, 
	syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH net-next] net/mpls: fix WARNING in mpls_gso_segment

On Thu, Feb 22, 2024 at 5:00 AM Lizhi Xu <lizhi.xu@...driver.com> wrote:
>
> When the network header pointer is greater than the inner network header, the
> difference between the two can cause mpls_hlen overflow.
>
> Reported-and-tested-by: syzbot+99d15fcdb0132a1e1a82@...kaller.appspotmailcom
> Signed-off-by: Lizhi Xu <lizhi.xu@...driver.com>
> ---
>  net/mpls/mpls_gso.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/mpls/mpls_gso.c b/net/mpls/mpls_gso.c
> index 533d082f0701..2ab24b2fd90f 100644
> --- a/net/mpls/mpls_gso.c
> +++ b/net/mpls/mpls_gso.c
> @@ -25,11 +25,11 @@ static struct sk_buff *mpls_gso_segment(struct sk_buff *skb,
>         netdev_features_t mpls_features;
>         u16 mac_len = skb->mac_len;
>         __be16 mpls_protocol;
> -       unsigned int mpls_hlen;
> +       int mpls_hlen;
>
>         skb_reset_network_header(skb);
>         mpls_hlen = skb_inner_network_header(skb) - skb_network_header(skb);
> -       if (unlikely(!mpls_hlen || mpls_hlen % MPLS_HLEN))
> +       if (unlikely(mpls_hlen <= 0 || mpls_hlen % MPLS_HLEN))
>                 goto out;
>         if (unlikely(!pskb_may_pull(skb, mpls_hlen)))
>                 goto out;
> --
> 2.43.0
>

I think Florian posted this patch, right ?

We must add a Fixes: tag

Also we should ask ourselves :
Why are we even looking at skb_inner_network_header(skb) if this was not set ?

Lets not hide a real bug, we need to understand the root cause.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ