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] [day] [month] [year] [list]
Message-ID: <CANn89iLmY26C05__4L9esOkBn1nEU8N7w0yBOU=CSbF7DQ6Aqg@mail.gmail.com>
Date: Fri, 19 Apr 2024 16:03:55 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org, 
	David Ahern <dsahern@...nel.org>, eric.dumazet@...il.com, 
	Andreas Roeseler <andreas.a.roeseler@...il.com>
Subject: Re: [PATCH net] icmp: prevent possible NULL dereferences from icmp_build_probe()

On Fri, Apr 19, 2024 at 3:51 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Fri, Apr 19, 2024 at 3:45 PM Jakub Kicinski <kuba@...nel.org> wrote:
> >
> > On Fri, 19 Apr 2024 10:53:32 +0000 Eric Dumazet wrote:
> > > +     in6_dev = __in6_dev_get(dev);
> > > +     if (in6_dev && !list_empty(&in6_dev->addr_list))
> >
> > There's got to be some conditional include somewhere because this seems
> > to break cut-down builds (presumably IPv6=n):
> >
> >
> > net/ipv4/icmp.c: In function ‘icmp_build_probe’:
> > net/ipv4/icmp.c:1125:19: error: implicit declaration of function ‘__in6_dev_get’; did you mean ‘in_dev_get’? [-Werror=implicit-function-declaration]
> >  1125 |         in6_dev = __in6_dev_get(dev);
> >       |                   ^~~~~~~~~~~~~
> >       |                   in_dev_get
> > net/ipv4/icmp.c:1125:17: error: assignment to ‘struct inet6_dev *’ from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
> >  1125 |         in6_dev = __in6_dev_get(dev);
> >       |                 ^
> > --
> > pw-bot: cr
>
> Ah right, __in6_dev_get() is not defined for CONFIG_IPV6=n...

Nope, I just have to add one include, that was conditionally pulled.

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index e1aaad4bf09cd43d9f3b376416b79a8b2c0a63ca..437e782b9663bb59acb900c0558137ddd401cd02
100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -92,6 +92,7 @@
 #include <net/inet_common.h>
 #include <net/ip_fib.h>
 #include <net/l3mdev.h>
+#include <net/addrconf.h>

 /*
  *     Build xmit assembly blocks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ