Thread (5 messages) flat view 5 messages, 4 authors, 2021-11-23

Re: [PATCH net] net: nexthop: fix null pointer dereference when IPv6 is not enabled

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-23 11:50:13
Also in: stable

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Tue, 23 Nov 2021 12:27:19 +0200 you wrote:
From: Nikolay Aleksandrov <redacted>

When we try to add an IPv6 nexthop and IPv6 is not enabled
(!CONFIG_IPV6) we'll hit a NULL pointer dereference[1] in the error path
of nh_create_ipv6() due to calling ipv6_stub->fib6_nh_release. The bug
has been present since the beginning of IPv6 nexthop gateway support.
Commit 1aefd3de7bc6 ("ipv6: Add fib6_nh_init and release to stubs") tells
us that only fib6_nh_init has a dummy stub because fib6_nh_release should
not be called if fib6_nh_init returns an error, but the commit below added
a call to ipv6_stub->fib6_nh_release in its error path. To fix it return
the dummy stub's -EAFNOSUPPORT error directly without calling
ipv6_stub->fib6_nh_release in nh_create_ipv6()'s error path.

[...]
Here is the summary with links:
  - [net] net: nexthop: fix null pointer dereference when IPv6 is not enabled
    https://git.kernel.org/netdev/net/c/1c743127cc54

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help