]> git.baikalelectronics.ru Git - kernel.git/commit
inet: Avoid potential NULL peer dereference.
authorDavid S. Miller <davem@davemloft.net>
Mon, 11 Jun 2012 11:13:57 +0000 (04:13 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Jun 2012 11:13:57 +0000 (04:13 -0700)
commitc9e71089a9752a0820bb7d321ffaccf5c38db459
tree639e89875cd047bb461ab61348050586ceca56b2
parenta7ff3df499cdedbd2e5904558d64be15805cfaaf
inet: Avoid potential NULL peer dereference.

We handle NULL in rt{,6}_set_peer but then our caller will try to pass
that NULL pointer into inet_putpeer() which isn't ready for it.

Fix this by moving the NULL check one level up, and then remove the
now unnecessary NULL check from inetpeer_ptr_set_peer().

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inetpeer.h
net/ipv4/route.c
net/ipv6/route.c