]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net/tcp: Consistently align TCP-AO option in the header
authorDmitry Safonov <dima@arista.com>
Mon, 4 Dec 2023 19:00:41 +0000 (19:00 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Wed, 6 Dec 2023 11:36:55 +0000 (12:36 +0100)
commitda7dfaa6d6f731c30eca6ffa808b83634d43e26f
tree6664d5827e0611238fc46e4225a8b435754d72a7
parent714589c2742209cc228991b115e48548fb8d89cf
net/tcp: Consistently align TCP-AO option in the header

Currently functions that pre-calculate TCP header options length use
unaligned TCP-AO header + MAC-length for skb reservation.
And the functions that actually write TCP-AO options into skb do align
the header. Nothing good can come out of this for ((maclen % 4) != 0).

Provide tcp_ao_len_aligned() helper and use it everywhere for TCP
header options space calculations.

Fixes: 1e03d32bea8e ("net/tcp: Add TCP-AO sign to outgoing packets")
Signed-off-by: Dmitry Safonov <dima@arista.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/tcp_ao.h
net/ipv4/tcp_ao.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_output.c
net/ipv6/tcp_ipv6.c