netty / netty-incubator-transport-io_uring

Apache License 2.0
194 stars 39 forks source link

IP_RECVORIGDSTADDR not working #12

Open ghost opened 3 years ago

ghost commented 3 years ago
Unknown channel option 'IP_RECVORIGDSTADDR' for channel '[id: 0x8d4431fe]'
normanmaurer commented 3 years ago

Yep I think we not support this one atm... PRs welcome :)

igor-lukyanov commented 3 years ago

Tried the commit https://github.com/netty/netty-incubator-transport-io_uring/pull/13 in our real app. At first sight, it seems to work (no errors occur anymore during the setOption(...) call), but it's hard to judge if it's actually fixing things (i.e. if after setting up the option local address 0.0.0.0 starts to get substituted with tproxy remote address like 10.xx.xx.xx) apparently because of the other bug https://github.com/netty/netty-incubator-transport-io_uring/issues/10 which causes remote addr to be always 0.0.0.0.

igor-lukyanov commented 3 years ago

Due to a CVE related to io_uring and AF_LOCAL sockets https://bugs.chromium.org/p/project-zero/issues/detail?id=1975 sending of ancillary data (which is used by IP_RECVORIGDSTADDR) was completely disabled in io_uring stack. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d69e07793f89 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=181e448d8709

It was partially fixed in 5.10 release candidates, but only for TCP sockets. https://github.com/torvalds/linux/commit/583bbf0624dfd8fc45f1049be1d4980be59451ff

We'll post a patch to LKML and ask to enable cmsg for io_uring+UDP as well. Until it's done this task can't be implemented.

normanmaurer commented 3 years ago

Sounds good... thanks for keep us posted

normanmaurer commented 3 years ago

This is fixed in 5.12 ... We may want to pick this up again