Skip to content

net/tcp-md5: Verify segments on TIME_WAIT sockets

Dmitry Safonov lkml netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net/tcp: Separate TCP-MD5 signing from tcp_v{4,6}_send_reset()net/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+152 -1310 replies
2/5net/tcp: Use tcp_v6_md5_hash_skb() instead of .calc_md5_hash()include/net/tcp.h net/ipv4/tcp.c net/ipv6/tcp_ipv6.c+16 -100 replies
3/5net/tcp-md5: Verify inbound segments on twskinclude/net/tcp.h net/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+19 -70 replies
4/5net/tcp-md5: Don't send RST if key (dis)appearednet/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+18 -00 replies
5/5net/tcp-md5: Don't send ACK if key (dis)appearsnet/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] net/tcp-md5: Verify segments on TIME_WAIT sockets

Hi,

Started as a refactoring of tcp_v{4,6}_send_reset(), in order to prepare it for TCP-AO signing for RST segments. As you can see the previous TCP-AO-v5 [1] version of those functions, they get too big and nasty. Patches 1 and 2 seem more-or-less straight-forward to me.

But then another thing that I wanted to fix for TCP-AO-version6 was accepting of unsigned or incorrectly signed segments on twsk, which is against RFC5925 (7.2) that requires checking the signature. So, I decided to give it a shot and fix twsk for TCP-MD5 as well.
That seems more questionable, that's why I'm sending patch 3 as RFC.

And the last part, patches 4 and 5 are paranoid checks made to minimize cases when inbound segment's signature and RST/ACK reply aren't consistent. This is direct result of RFC2385 that lacks key rotation mechanism. Probably, patches 4 and 5 are a bit too much, sending them for review anyway in case such paranoia makes sense.

Thanks,
Dmitry

Cc David Ahern <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Dmitry Safonov <[email protected]>
Cc Eric Dumazet <[email protected]>
Cc Hideaki YOSHIFUJI <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Leonard Crestez <[email protected]>
Cc Paolo Abeni <[email protected]>
Cc Salam Noureddine <[email protected]>

[1]: https://lore.kernel.org/all/[email protected]/T/#u

Dmitry Safonov (5):
net/tcp: Separate TCP-MD5 signing from tcp_v{4,6}_send_reset() net/tcp: Use tcp_v6_md5_hash_skb() instead of .calc_md5_hash() [RFC] net/tcp-md5: Verify inbound segments on twsk [RFC] net/tcp-md5: Don't send RST if key (dis)appeared [RFC] net/tcp-md5: Don't send ACK if key (dis)appears

 include/net/tcp.h   |  18 +++-
 net/ipv4/tcp.c      |   9 +-
 net/ipv4/tcp_ipv4.c | 196 +++++++++++++++++++++++++-------------------
 net/ipv6/tcp_ipv6.c | 130 +++++++++++++++++------------
 4 files changed, 207 insertions(+), 146 deletions(-)

base-commit: ba0ad6ed89fd5dada3b7b65ef2b08e95d449d4ab

Signature · 1 line
2.40.0