aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2019-03-18 19:47:00 +0800
committerBen Hutchings <ben@decadent.org.uk>2019-08-13 12:38:44 +0100
commit3ef66b61b37b5e28dad11f3c3937f8be647e0e07 (patch)
treefc7df4ab6cdf4dae0983ebf8b1062a3b4cb44862 /include
parent7e8343060fc2f97a50bd64dd373fbe27939ba5bb (diff)
downloadlinux-stable-3ef66b61b37b5e28dad11f3c3937f8be647e0e07.tar.gz
sctp: get sctphdr by offset in sctp_compute_cksum
commit 273160ffc6b993c7c91627f5a84799c66dfe4dee upstream. sctp_hdr(skb) only works when skb->transport_header is set properly. But in Netfilter, skb->transport_header for ipv6 is not guaranteed to be right value for sctphdr. It would cause to fail to check the checksum for sctp packets. So fix it by using offset, which is always right in all places. v1->v2: - Fix the changelog. Fixes: e6d8b64b34aa ("net: sctp: fix and consolidate SCTP checksumming code") Reported-by: Li Shuang <shuali@redhat.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/net/sctp/checksum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 32ee65a30aff11..1c6e6c0766ca09 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -61,7 +61,7 @@ static inline __wsum sctp_csum_combine(__wsum csum, __wsum csum2,
static inline __le32 sctp_compute_cksum(const struct sk_buff *skb,
unsigned int offset)
{
- struct sctphdr *sh = sctp_hdr(skb);
+ struct sctphdr *sh = (struct sctphdr *)(skb->data + offset);
const struct skb_checksum_ops ops = {
.update = sctp_csum_update,
.combine = sctp_csum_combine,