mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 08:31:55 +00:00
c78a0b4a78
It's important that we clear most header fields during encapsulation and
decapsulation, because the packet is substantially changed, and we don't
want any info leak or logic bug due to an accidental correlation. But,
for encapsulation, it's wrong to clear skb->hash, since it's used by
fq_codel and flow dissection in general. Without it, classification does
not proceed as usual. This change might make it easier to estimate the
number of innerflows by examining clustering of out of order packets,
but this shouldn't open up anything that can't already be inferred
otherwise (e.g. syn packet size inference), and fq_codel can be disabled
anyway.
Furthermore, it might be the case that the hash isn't used or queried at
all until after wireguard transmits the encrypted UDP packet, which
means skb->hash might still be zero at this point, and thus no hash
taken over the inner packet data. In order to address this situation, we
force a calculation of skb->hash before encrypting packet data.
Of course this means that fq_codel might transmit packets slightly more
out of order than usual. Toke did some testing on beefy machines with
high quantities of parallel flows and found that increasing the
reply-attack counter to 8192 takes care of the most pathological cases
pretty well.
Reported-by: Dave Taht <dave.taht@gmail.com>
Reviewed-and-tested-by: Toke Høiland-Jørgensen <toke@toke.dk>
Fixes:
|
||
---|---|---|
.. | ||
selftest | ||
allowedips.c | ||
allowedips.h | ||
cookie.c | ||
cookie.h | ||
device.c | ||
device.h | ||
main.c | ||
Makefile | ||
messages.h | ||
netlink.c | ||
netlink.h | ||
noise.c | ||
noise.h | ||
peer.c | ||
peer.h | ||
peerlookup.c | ||
peerlookup.h | ||
queueing.c | ||
queueing.h | ||
ratelimiter.c | ||
ratelimiter.h | ||
receive.c | ||
send.c | ||
socket.c | ||
socket.h | ||
timers.c | ||
timers.h | ||
version.h |