Skip to contentSkip to conversation

4.19 queue: netfilter: conntrack: unregister ipv4 sockopts on error unwind

DISCUSSION Pavel Machek 2 participants 2 messages Jun 7, 2021 Stable branch

lore
Share & tools
lore
#0 lore raw

Hi!

That patch is wrong for 4.19. Wrong version is 066585c43 in stable queue.

netfilter: conntrack: unregister ipv4 sockopts on error unwind

[ Upstream commit 22cbdbcfb61acc78d5fc21ebb13ccc0d7e29f793 ]

When ipv6 sockopt register fails, the ipv4 one needs to be removed.

...

+++ b/net/netfilter/nf_conntrack_proto.c
@@ -962,7 +962,7 @@ int nf_conntrack_proto_init(void)
nf_unregister_sockopt(&so_getorigdst);
#if IS_ENABLED(CONFIG_IPV6)
cleanup_sockopt:
- nf_unregister_sockopt(&so_getorigdst6);
+ nf_unregister_sockopt(&so_getorigdst);
#endif
return ret;

Note the context. cleanup_sockopt2: needs to do nf_unregister_sockopt(&so_getorigdst6);, otherwise we end up unregistering the same pointer twice.

(AFAICT it is ok in mainline and 5.10).

Best regards,
Pavel

Signature · 2 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
maintainer
#1 lore raw
Quoted 24 lines · Pavel Machek

Hi!

That patch is wrong for 4.19. Wrong version is 066585c43 in stable queue.

netfilter: conntrack: unregister ipv4 sockopts on error unwind

[ Upstream commit 22cbdbcfb61acc78d5fc21ebb13ccc0d7e29f793 ]

When ipv6 sockopt register fails, the ipv4 one needs to be removed.

...

+++ b/net/netfilter/nf_conntrack_proto.c

(quoted diff) +0 -0
@@ -962,7 +962,7 @@ int nf_conntrack_proto_init(void)
 nf_unregister_sockopt(&so_getorigdst);
 #if IS_ENABLED(CONFIG_IPV6)

cleanup_sockopt:

(quoted diff) +1 -1
-       nf_unregister_sockopt(&so_getorigdst6);
+       nf_unregister_sockopt(&so_getorigdst);

#endif
return ret;

Quoted 3 lines

Note the context. cleanup_sockopt2: needs to do nf_unregister_sockopt(&so_getorigdst6);, otherwise we end up unregistering the same pointer twice.

Good catch! I've dropped it from 4.19, the rest of the trees look ok.

Signature · 2 lines
Thanks,
Sasha