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:   Wed, 23 Feb 2022 14:08:06 +0800
From:   Xin Long <lucien.xin@...il.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     network dev <netdev@...r.kernel.org>, davem <davem@...emloft.net>,
        Vasiliy Kulikov <segoon@...nwall.com>
Subject: Re: [PATCH net] ping: fix the dif and sdif check in ping_lookup

On Thu, Feb 17, 2022 at 11:57 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Wed, 16 Feb 2022 00:20:52 -0500 Xin Long wrote:
> >       if (skb->protocol == htons(ETH_P_IP)) {
> > +             dif = inet_iif(skb);
> > +             sdif = inet_sdif(skb);
> >               pr_debug("try to find: num = %d, daddr = %pI4, dif = %d\n",
> >                        (int)ident, &ip_hdr(skb)->daddr, dif);
> >  #if IS_ENABLED(CONFIG_IPV6)
> >       } else if (skb->protocol == htons(ETH_P_IPV6)) {
> > +             dif = inet6_iif(skb);
> > +             sdif = inet6_sdif(skb);
> >               pr_debug("try to find: num = %d, daddr = %pI6c, dif = %d\n",
> >                        (int)ident, &ipv6_hdr(skb)->daddr, dif);
> >  #endif
> > +     } else {
> > +             pr_err("ping: protocol(%x) is not supported\n", ntohs(skb->protocol));
> > +             return NULL;
> >       }
>
> Are you sure this is not reachable from some networking path allowing
> attacker (or local user) to DoS the kernel logs?
Hi, Jakub, sorry for late.

I actually didn't see how a skb with protocol != IP/IPV6 could reach here.
ping_err() is using "BUG()" for this kind of case.
I added this 'else' branch mostly to avoid the possible compiling
warning for "Use of uninitialized value dif/sdif".

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ