Open mweinelt opened 1 month ago
Hey. Sorry about the wait.
This one looks difficult. Might take a while to find.
Couple of notes:
This is not a crash; it's a warning. It's supposed to be an impossible situation, but Jool recovers anyway. The worst that should happen is the packet gets discarded. (And that mess of text in the logs.)
Was your kernel really unusable after this?
This is the hole punching code.
I've never seen anyone talk about it, so I don't think anyone's using it, at least consciously. I implemented it so long ago, it might as well have been broken by some intrusive refactor over the years.
Are you really trying to punch a hole through Jool? If you don't care about it, you can turn it off:
jool global update maximum-simultaneous-opens 0
or
"global": {
"pool6": "64:ff9b::/96",
"maximum-simultaneous-opens": 0
},
Was your kernel really unusable after this?
Yes, the VM was not forwarding packets any longer, and I was unable to SSH in. Needed a hard reset.
Are you really trying to punch a hole through Jool? If you don't care about it, you can turn it off:
No, we were not explicitly trying to do hole punching. I can give that a shot, but it will take until 2025-09 until I get another chance to deploy that setup.
Yes, the VM was not forwarding packets any longer, and I was unable to SSH in. Needed a hard reset.
Drat. This is two bugs, then.
This is altogether weird. As far as I can tell, hole punching shouldn't even work on Jool, because it doesn't do TCP port preservation at all.
It seems this code isn't really doing anything. (Apart from crashing, that is.) It's looking like the right course of action would be to just delete it.
Or implement configurable port preservation somehow. Except no one has ever requested it.
(Just thinking out loud.)
Bit of background:
The session members are called src6
, dst6
, src4
and dst4
. They're named after the packet fields in the IPv6 -> IPv4 direction.
src6
is the (original) IPv6 packet's source address,dst6
is the (original) IPv6 packet's destination address,src4
is the (translated) IPv4 packet's source address,dst4
is the (translated) IPv4 packet's destination address.In TCP, dst6
always equals pool6
+ dst4
. (eg. [64:ff9b::192.0.2.1]:8080 = 64:ff9b::/96 + 192.0.2.1:8080
)
The names make less sense IPv4 -> IPv6 direction, as they seem inverted:
dst4
is the (original) IPv4 packet's source address,src4
is the (original) IPv6 packet's destination address,dst6
is the (translated) IPv6 packet's source address,src6
is the (translated) IPv6 packet's destination address.But that's something RFC 6146 seems happy to live with.
Jool's current hole punching algorithm (which, according to my notes, involved a bunch of guesswork) is
dst6
, src4
and dst4
) in a dedicated table for 6 seconds.dst6
claims the connection.So even though Jool doesn't do port preservation between src6
and src4
by itself, punching a hole is still possible because the IPv4 endpoint actually gets to decide the value of src4
's port. (In practice, it'll probably always choose the same one as src6
.)
Hmmmmmmmmm.
Hi!
We used jool recently for 464XLAT with Android clients exclusively. They managed to trigger the following crash:
Jool 4.1.13 Kernel: 6.6.52 Distro: NixOS