netfilter: nft_payload: do not update layer 4 checksum when mangling fragments
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: nft_payload: do not update layer 4 checksum when mangling fragments
From: Pablo Neira Ayuso <[email protected]>
commit 4e1860a3863707e8177329c006d10f9e37e097a8 upstream.
IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates.
---
This is already in the 5.y branches but 4.19 needs a minor tweak as ->fragoff member resides in xt sub-struct.
net/netfilter/nft_payload.c | 3 +++ 1 file changed, 3 insertions(+)
net/netfilter/nft_payload.c +3 -0
@@ -194,6 +194,9 @@ static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt, struct sk_buff *skb, unsigned int *l4csum_offset) { +if (pkt->xt.fragoff) +return -1 ; +switch (pkt->tprot) {case IPPROTO_TCP : *l4csum_offset = offsetof(struct tcphdr , check);
Signature · 1 line
2.34.1
Pablo Neira Ayuso
maintainerQuoted 7 lines · Florian Westphal
From: Pablo Neira Ayuso <[email protected]>
commit
4e1860a3863707e8177329c006d10f9e37e097a8upstream.IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates.
Quoted 7 lines
Fixes 1814096980bb ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields")Reported-and-tested-by Steffen Weinreich <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>Signed-off-by Florian Westphal <[email protected]>---
This is already in the 5.y branches but 4.19 needs a minor tweak as ->fragoff member resides in xt sub-struct.
Thanks for taking care of this -stable submission.
Quoted 20 lines
net/netfilter/nft_payload.c | 3 +++ 1 file changed, 3 insertions(+)net/netfilter/nft_payload.c +3
-0@@ -194,6 +194,9 @@ static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt, struct sk_buff *skb, unsigned int *l4csum_offset) { +if (pkt->xt.fragoff) +return -1 ; +switch (pkt->tprot) {case IPPROTO_TCP : *l4csum_offset = offsetof(struct tcphdr , check);Signature · 1 line
2.34.1
Greg KH
maintainerQuoted 7 lines · Florian Westphal
From: Pablo Neira Ayuso <[email protected]>
commit
4e1860a3863707e8177329c006d10f9e37e097a8upstream.IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates.
Quoted 7 lines
Fixes 1814096980bb ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields")Reported-and-tested-by Steffen Weinreich <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>Signed-off-by Florian Westphal <[email protected]>---
This is already in the 5.y branches but 4.19 needs a minor tweak as ->fragoff member resides in xt sub-struct.
I don't see this commit in the 5.10 or 5.4 branches, am I missing something?
confused,
greg k-h
Florian Westphal
maintainerQuoted 16 lines · Greg KH
Quoted 7 lines · Florian Westphal
From: Pablo Neira Ayuso <[email protected]>
commit
4e1860a3863707e8177329c006d10f9e37e097a8upstream.IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates.
Quoted 7 lines
Fixes 1814096980bb ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields")Reported-and-tested-by Steffen Weinreich <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>Signed-off-by Florian Westphal <[email protected]>---
This is already in the 5.y branches but 4.19 needs a minor tweak as ->fragoff member resides in xt sub-struct.
Quoted 2 lines
I don't see this commit in the 5.10 or 5.4 branches, am I missing something?
Oh, indeed. Can you place this patch in 5.4 and 5.10 too?
Releases >= v5.14 should be covered given upstream commit works as-is on those.
Thanks,
Florian
Greg KH
maintainerQuoted 17 lines · Florian Westphal
Quoted 16 lines · Greg KH
Quoted 14 lines · Florian Westphal
From: Pablo Neira Ayuso <[email protected]>
commit
4e1860a3863707e8177329c006d10f9e37e097a8upstream.IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates.
Fixes 1814096980bb ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields")Reported-and-tested-by Steffen Weinreich <[email protected]>Signed-off-by Pablo Neira Ayuso <[email protected]>Signed-off-by Florian Westphal <[email protected]>---
This is already in the 5.y branches but 4.19 needs a minor tweak as ->fragoff member resides in xt sub-struct.
Quoted 4 lines
Quoted 2 lines
I don't see this commit in the 5.10 or 5.4 branches, am I missing something?
Oh, indeed. Can you place this patch in 5.4 and 5.10 too?
Now done, and it was needed for 4.14.y, so I added it there too, thanks!
greg k-h