The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net] xfrm: iptfs: avoid canceling reorder-window drop timer
@ 2026-07-30  3:12 Lilly Aronleigh
  2026-08-24  5:14 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Lilly Aronleigh @ 2026-07-30  3:12 UTC (permalink / raw)
  To: Steffen Klassert, Herbert Xu
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Christian Hopps, netdev, linux-kernel

IP-TFS uses xtfs->drop_timer for both partial inner-packet
reassembly and the reorder-window drop timeout. Reassembly completion
currently cancels the timer unconditionally.

That is only correct when the reorder window is empty. If the reorder
window already contains saved packets, the same timer belongs to the
reorder-window state and must remain armed so the missing sequence can
be considered lost and the window can advance.

Only cancel drop_timer from __iptfs_reassem_done() when the reorder
window has no saved packets. The existing drop_lock serializes this
with the reorder-window paths, and a failed cancel remains harmless.

Tested with a reproducer that completes reassembly while the reorder
window contains saved packets.

With this change, the reorder-window timeout remains active and the
window can advance correctly when the missing sequence is not received.

Fixes: 0756947654468 ("xfrm: iptfs: handle received fragmented inner packets")
Assisted-by: ChatGPT:5.5-extrahigh
Assisted-by: Claude:4.6-opus
Signed-off-by: Lilly Aronleigh <lilly@aronleigh.au>
---
 net/xfrm/xfrm_iptfs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c
index ad810d1f97c..02fbb8d781a 100644
--- a/net/xfrm/xfrm_iptfs.c
+++ b/net/xfrm/xfrm_iptfs.c
@@ -698,8 +698,12 @@ static void __iptfs_reassem_done(struct
xfrm_iptfs_data *xtfs, bool free)
 {
        assert_spin_locked(&xtfs->drop_lock);

-       /* We don't care if it works locking takes care of things */
-       hrtimer_try_to_cancel(&xtfs->drop_timer);
+       /*
+        * The drop timer also drives the reorder window timeout. Locking makes
+        * a failed cancel harmless.
+        */
+       if (!xtfs->w_savedlen)
+               hrtimer_try_to_cancel(&xtfs->drop_timer);
        if (free)
                kfree_skb(xtfs->ra_newskb);
        xtfs->ra_newskb = NULL;
--
2.43.0

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

end of thread, other threads:[~2026-08-24  5:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-30  3:12 [PATCH net] xfrm: iptfs: avoid canceling reorder-window drop timer Lilly Aronleigh
2026-08-24  5:14 ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox