Message ID | 20250127060757.3946314-2-steffen.klassert@secunet.com (mailing list archive) |
---|---|
State | Accepted |
Commit | c05c5e5aa163f4682ca97a2f0536575fc7dbdecb |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/5] xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO | expand |
Hello: This series was applied to netdev/net.git (main) by Steffen Klassert <steffen.klassert@secunet.com>: On Mon, 27 Jan 2025 07:07:53 +0100 you wrote: > From: Jianbo Liu <jianbol@nvidia.com> > > When skb needs GSO and wrap around happens, if xo->seq.low (seqno of > the first skb segment) is before the last seq number but oseq (seqno > of the last segment) is after it, xo->seq.low is still bigger than > replay_esn->oseq while oseq is smaller than it, so the update of > replay_esn->oseq_hi is missed for this case wrap around because of > the change in the cited commit. > > [...] Here is the summary with links: - [1/5] xfrm: replay: Fix the update of replay_esn->oseq_hi for GSO https://git.kernel.org/netdev/net/c/c05c5e5aa163 - [2/5] xfrm: state: fix out-of-bounds read during lookup https://git.kernel.org/netdev/net/c/e952837f3ddb - [3/5] xfrm: delete intermediate secpath entry in packet offload mode https://git.kernel.org/netdev/net/c/600258d555f0 - [4/5] xfrm: Fix the usage of skb->sk https://git.kernel.org/netdev/net/c/1620c88887b1 - [5/5] xfrm: Don't disable preemption while looking up cache state. https://git.kernel.org/netdev/net/c/6c9b7db96db6 You are awesome, thank you!
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c index bc56c6305725..235bbefc2aba 100644 --- a/net/xfrm/xfrm_replay.c +++ b/net/xfrm/xfrm_replay.c @@ -714,10 +714,12 @@ static int xfrm_replay_overflow_offload_esn(struct xfrm_state *x, struct sk_buff oseq += skb_shinfo(skb)->gso_segs; } - if (unlikely(xo->seq.low < replay_esn->oseq)) { - XFRM_SKB_CB(skb)->seq.output.hi = ++oseq_hi; - xo->seq.hi = oseq_hi; - replay_esn->oseq_hi = oseq_hi; + if (unlikely(oseq < replay_esn->oseq)) { + replay_esn->oseq_hi = ++oseq_hi; + if (xo->seq.low < replay_esn->oseq) { + XFRM_SKB_CB(skb)->seq.output.hi = oseq_hi; + xo->seq.hi = oseq_hi; + } if (replay_esn->oseq_hi == 0) { replay_esn->oseq--; replay_esn->oseq_hi--;