]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-3.18/sctp-get-sctphdr-by-offset-in-sctp_compute_cksum.patch
fix up powerpc patch headers, I messed up.
[thirdparty/kernel/stable-queue.git] / queue-3.18 / sctp-get-sctphdr-by-offset-in-sctp_compute_cksum.patch
CommitLineData
e6c75312
GKH
1From foo@baz Thu Mar 28 21:57:57 CET 2019
2From: Xin Long <lucien.xin@gmail.com>
3Date: Mon, 18 Mar 2019 19:47:00 +0800
4Subject: sctp: get sctphdr by offset in sctp_compute_cksum
5
6From: Xin Long <lucien.xin@gmail.com>
7
8[ Upstream commit 273160ffc6b993c7c91627f5a84799c66dfe4dee ]
9
10sctp_hdr(skb) only works when skb->transport_header is set properly.
11
12But in Netfilter, skb->transport_header for ipv6 is not guaranteed
13to be right value for sctphdr. It would cause to fail to check the
14checksum for sctp packets.
15
16So fix it by using offset, which is always right in all places.
17
18v1->v2:
19 - Fix the changelog.
20
21Fixes: e6d8b64b34aa ("net: sctp: fix and consolidate SCTP checksumming code")
22Reported-by: Li Shuang <shuali@redhat.com>
23Signed-off-by: Xin Long <lucien.xin@gmail.com>
24Signed-off-by: David S. Miller <davem@davemloft.net>
25Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26---
27 include/net/sctp/checksum.h | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30--- a/include/net/sctp/checksum.h
31+++ b/include/net/sctp/checksum.h
32@@ -60,7 +60,7 @@ static inline __wsum sctp_csum_combine(_
33 static inline __le32 sctp_compute_cksum(const struct sk_buff *skb,
34 unsigned int offset)
35 {
36- struct sctphdr *sh = sctp_hdr(skb);
37+ struct sctphdr *sh = (struct sctphdr *)(skb->data + offset);
38 __le32 ret, old = sh->checksum;
39 const struct skb_checksum_ops ops = {
40 .update = sctp_csum_update,