From b3ceca0c80aba83f38c4f8da8054f42f5cbd5243 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 10 Nov 2020 19:54:39 +0000 Subject: [PATCH] Clear tp->tod in t4_pcb_detach(). Otherwise, a socket can have a non-NULL tp->tod while TF_TOE is clear. In particular, if a newly accepted socket falls back to non-TOE due to an active open failure, the non-TOE socket will still have tp->tod set even though TF_TOE is clear. Reviewed by: np MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27028 --- sys/dev/cxgbe/tom/t4_tom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 7c01b424b2ec..705a2175f932 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -382,6 +382,7 @@ t4_pcb_detach(struct toedev *tod __unused, struct tcpcb *tp) } #endif + tp->tod = NULL; tp->t_toe = NULL; tp->t_flags &= ~TF_TOE; toep->flags &= ~TPF_ATTACHED;