Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPSTREAM: wireguard: socket: remove errant restriction on looping to β¦
β¦self It's already possible to create two different interfaces and loop packets between them. This has always been possible with tunnels in the kernel, and isn't specific to wireguard. Therefore, the networking stack already needs to deal with that. At the very least, the packet winds up exceeding the MTU and is discarded at that point. So, since this is already something that happens, there's no need to forbid the not very exceptional case of routing a packet back to the same interface; this loop is no different than others, and we shouldn't special case it, but rather rely on generic handling of loops in general. This also makes it easier to do interesting things with wireguard such as onion routing. At the same time, we add a selftest for this, ensuring that both onion routing works and infinite routing loops do not crash the kernel. We also add a test case for wireguard interfaces nesting packets and sending traffic between each other, as well as the loop in this case too. We make sure to send some throughput-heavy traffic for this use case, to stress out any possible recursion issues with the locks around workqueues. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Change-Id: I30fa88ef8ec8527c971e71b5a051126f07978b5d Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit b673e24aad36981f327a6570412ffa7754de8911) Bug: 152722841 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Change-Id: I30fa88ef8ec8527c971e71b5a051126f07978b5d Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> (cherry picked from commit f45e1b98ab6217de1c8610fbe61d9f8e6604f31d) Signed-off-by: TogoFire <togofire@mailfence.com>
- Loading branch information