All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: md5: incorrect tcp_header_len for incoming connections
@ 2022-04-20 23:56 Francesco Ruggeri
  2022-04-21  0:20 ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: Francesco Ruggeri @ 2022-04-20 23:56 UTC (permalink / raw)
  To: pabeni, kuba, dsahern, yoshfuji, davem, edumazet, linux-kernel,
	netdev, fruggeri

In tcp_create_openreq_child we adjust tcp_header_len for md5 using the
remote address in newsk. But that address is still 0 in newsk at this
point, and it is only set later by the callers (tcp_v[46]_syn_recv_sock).
Use the address from the request socket instead.

Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
---
 net/ipv4/tcp_minisocks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 6366df7aaf2a..6854bb1fb32b 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -531,7 +531,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
 	newtp->tsoffset = treq->ts_off;
 #ifdef CONFIG_TCP_MD5SIG
 	newtp->md5sig_info = NULL;	/*XXX*/
-	if (newtp->af_specific->md5_lookup(sk, newsk))
+	if (treq->af_specific->req_md5_lookup(sk, req_to_sk(req)))
 		newtp->tcp_header_len += TCPOLEN_MD5SIG_ALIGNED;
 #endif
 	if (skb->len >= TCP_MSS_DEFAULT + newtp->tcp_header_len)
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-21  0:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 23:56 [PATCH] tcp: md5: incorrect tcp_header_len for incoming connections Francesco Ruggeri
2022-04-21  0:20 ` Eric Dumazet
2022-04-21  0:32   ` Francesco Ruggeri
2022-04-21  0:37     ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.