[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190705.161933.2002038370655051093.davem@davemloft.net>
Date: Fri, 05 Jul 2019 16:19:33 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: idosch@...sch.org
Cc: netdev@...r.kernel.org, dsahern@...il.com, jiri@...lanox.com,
shalomt@...lanox.com, mlxsw@...lanox.com, idosch@...lanox.com
Subject: Re: [PATCH net] ipv4: Fix NULL pointer dereference in
ipv4_neigh_lookup()
From: Ido Schimmel <idosch@...sch.org>
Date: Thu, 4 Jul 2019 19:26:38 +0300
> From: Ido Schimmel <idosch@...lanox.com>
>
> Both ip_neigh_gw4() and ip_neigh_gw6() can return either a valid pointer
> or an error pointer, but the code currently checks that the pointer is
> not NULL.
>
> Fix this by checking that the pointer is not an error pointer, as this
> can result in a NULL pointer dereference [1]. Specifically, I believe
> that what happened is that ip_neigh_gw4() returned '-EINVAL'
> (0xffffffffffffffea) to which the offset of 'refcnt' (0x70) was added,
> which resulted in the address 0x000000000000005a.
>
> [1]
...
> Fixes: 5c9f7c1dfc2e ("ipv4: Add helpers for neigh lookup for nexthop")
> Signed-off-by: Ido Schimmel <idosch@...lanox.com>
> Reported-by: Shalom Toledo <shalomt@...lanox.com>
> Reviewed-by: Jiri Pirko <jiri@...lanox.com>
Applied, thanks.
Powered by blists - more mailing lists