提交 c3e22e05 编写于 作者: F Florian Westphal 提交者: Zhengchao Shao

netfilter: nat: fix udp checksum corruption

mainline inclusion
from mainline-v5.2-rc3
commit 6bac76db
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7O0PV
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6bac76db1da3cb162c425d58ae421486f8e43955

--------------------------------

Due to copy&paste error nf_nat_mangle_udp_packet passes IPPROTO_TCP,
resulting in incorrect udp checksum when payload had to be mangled.

Fixes: dac3fe72 ("netfilter: nat: remove csum_recalc hook")
Reported-by: NMarc Haber <mh+netdev@zugschlus.de>
Tested-by: NMarc Haber <mh+netdev@zugschlus.de>
Signed-off-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NZhengchao Shao <shaozhengchao@huawei.com>
上级 83abe3a3
......@@ -175,7 +175,7 @@ nf_nat_mangle_udp_packet(struct sk_buff *skb,
if (!udph->check && skb->ip_summed != CHECKSUM_PARTIAL)
return true;
nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_TCP,
nf_nat_csum_recalc(skb, nf_ct_l3num(ct), IPPROTO_UDP,
udph, &udph->check, datalen, oldlen);
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册