Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp528986yba; Mon, 1 Apr 2019 11:08:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGJ97Cy50r2mJTT2YK4/9z2tK+W+P2497/Iz4dHZI0mbwulo6X8lLQ/u4qthJoiNt40vvh X-Received: by 2002:a63:195e:: with SMTP id 30mr59035952pgz.312.1554142092472; Mon, 01 Apr 2019 11:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554142092; cv=none; d=google.com; s=arc-20160816; b=RBmTW5wgKNbwa0yT8l7VUv+Eb90AkYKY5xw58mSlgvGmd5cIivOnj0XC5WRyM5P64R Q2WpgDDiCjpgkNGHyQaL9XnQD8AFOCONhWd+21nNsA4JeikiXgkkD+RoYIjg1G2vIkvN O+opSDbS6rUIP/1XuYU4Pvzw2BhXxHZhVmIdYRYorG0ktng3YodeF7raWXiyURNP+Qdp 6BjoXMk95k3QNJv2/cFwevr3OCjDuKtDwW0eWRN03tuwJ1QECR2/AsLJxgLcv0sHGYiR 6DL1G9HW4u2AUXjbKKV0Dp6qIQIQ7OeNyR/Vehd+GCutge2SHgVOJR3I2lZBhu1V2wjr H/sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SWdQda0fjoth0bl7CXYtxTAIBeORWGulcs/FUzMYAEE=; b=P66E4Dq3vwZIUfacIb20Gij6VtCvHQMoTUNsPD2Q0O9ikLrcX+ymqyeZS2PlSuGFs4 wQkNNAA+0wbreDsgpT5rdaSipaJQEwWItac9A0I6TfO5yljvm9Qpn+1xJUu2wq+1B949 ASUUZmRCtmg9RlArnJW4oAx02wagTPo9R0ppTFpxk0SD/NIKMsGvz9HeqBG7Dnh+yqv3 +/AE3I25kbeEKxi9VCj73gYxvCndSKEzVYXXmTi0dlxDI2n5S8sH0jMYlV0JDii2+LtB 2FI90xzi+Y9By+h/NIu/7EFOCSBSp/aVMKTw52wgKP04cIp4lxg5Kj1mUXwAss2O/EwH BJCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rBlBZm6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si9176054pfc.46.2019.04.01.11.07.56; Mon, 01 Apr 2019 11:08:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rBlBZm6O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730436AbfDARNC (ORCPT + 99 others); Mon, 1 Apr 2019 13:13:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:35076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729962AbfDARM7 (ORCPT ); Mon, 1 Apr 2019 13:12:59 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 97C8721924; Mon, 1 Apr 2019 17:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554138779; bh=bz2f2gXd8wwdd7kneO1h+wOTZuiU1KnNNODS+O/bV0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rBlBZm6Oy62GqGgUi6JRnuZHYCCMm6Iju81FU0cgiszwJ2JgBV68X70dB2/yzbFst xPNbPA4d7OR0rkmVIRc+ltqDw7H8LpWKxhOmxJ3khiU7aH3jSg+V8YGBKFIEf1laFf AV5hZ+3NZ13kmZip6Kw+BVjHpWcHHIhio7fLMSrs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Shuang , Xin Long , "David S. Miller" Subject: [PATCH 4.19 019/134] sctp: get sctphdr by offset in sctp_compute_cksum Date: Mon, 1 Apr 2019 19:00:55 +0200 Message-Id: <20190401170046.372572653@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170044.243719205@linuxfoundation.org> References: <20190401170044.243719205@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit 273160ffc6b993c7c91627f5a84799c66dfe4dee ] 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 Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/net/sctp/checksum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h @@ -61,7 +61,7 @@ static inline __wsum sctp_csum_combine(_ 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,