Skip to content
Commit 160e9d27 authored by Hangbin Liu's avatar Hangbin Liu Committed by Jakub Kicinski
Browse files

ipv6: sr: fix invalid unregister error path



The error path of seg6_init() is wrong in case CONFIG_IPV6_SEG6_LWTUNNEL
is not defined. In that case if seg6_hmac_init() fails, the
genl_unregister_family() isn't called.

This issue exist since commit 46738b13 ("ipv6: sr: add option to control
lwtunnel support"), and commit 5559cea2 ("ipv6: sr: fix possible
use-after-free and null-ptr-deref") replaced unregister_pernet_subsys()
with genl_unregister_family() in this error path.

Fixes: 46738b13 ("ipv6: sr: add option to control lwtunnel support")
Reported-by: default avatarGuillaume Nault <gnault@redhat.com>
Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Reviewed-by: default avatarSabrina Dubroca <sd@queasysnail.net>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240509131812.1662197-4-liuhangbin@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6e370a77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment