mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
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 commit46738b1317
("ipv6: sr: add option to control lwtunnel support"), and commit5559cea2d5
("ipv6: sr: fix possible use-after-free and null-ptr-deref") replaced unregister_pernet_subsys() with genl_unregister_family() in this error path. Fixes:46738b1317
("ipv6: sr: add option to control lwtunnel support") Reported-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://lore.kernel.org/r/20240509131812.1662197-4-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6e370a771d
commit
160e9d2752
@ -551,6 +551,8 @@ int __init seg6_init(void)
|
||||
#endif
|
||||
#ifdef CONFIG_IPV6_SEG6_LWTUNNEL
|
||||
out_unregister_genl:
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_IPV6_SEG6_LWTUNNEL) || IS_ENABLED(CONFIG_IPV6_SEG6_HMAC)
|
||||
genl_unregister_family(&seg6_genl_family);
|
||||
#endif
|
||||
out_unregister_pernet:
|
||||
|
Loading…
Reference in New Issue
Block a user