Message ID | 20200319123930.212855115@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=1QoN=5E=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 368A4C4332D for <stable@archiver.kernel.org>; Thu, 19 Mar 2020 13:36:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0562E20663 for <stable@archiver.kernel.org>; Thu, 19 Mar 2020 13:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584624985; bh=rAVFUJsC2fbfSa72Ha8YXz2t+5YXLNBW2AQww6znxFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=h1Vv0rc/aWoeup3rIcOg4spAsk3B6AAdz1L1cK8TFni7bwd+/v1NWVSPLgXuKholA 22JMKuR95Tlwm/A+usZ1NGDE1Fcyqw9v7Tfn86uwQ9fvezGXZPp1IpaKdICIUH15DJ X5L0hVqfQNORReNOafsej+tU37k3PKsal1HnaSr4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727958AbgCSNKR (ORCPT <rfc822;stable@archiver.kernel.org>); Thu, 19 Mar 2020 09:10:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:54880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727790AbgCSNKN (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 19 Mar 2020 09:10:13 -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 B5CCE21841; Thu, 19 Mar 2020 13:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623411; bh=rAVFUJsC2fbfSa72Ha8YXz2t+5YXLNBW2AQww6znxFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KzpzweSqq+Bx8zFOg3L0JJTv/t6vMqHzrp50ewyxb1PJcwsnQWrjvZFTybIFxJNou IUlyFrk0demdlrZ488yXfk4Z2Gggqpjs9nkhvoEAU3nJwQa+VAbivyOt0r7tT8xcKx Ow3JBRv3nCTyPL9f49roA4YG+CchnvSIz6g9uOU8= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Eric Dumazet <edumazet@google.com>, syzbot <syzkaller@googlegroups.com>, "David S. Miller" <davem@davemloft.net> Subject: [PATCH 4.9 05/90] gre: fix uninit-value in __iptunnel_pull_header Date: Thu, 19 Mar 2020 13:59:27 +0100 Message-Id: <20200319123930.212855115@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123928.635114118@linuxfoundation.org> References: <20200319123928.635114118@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/net/ipv4/gre_demux.c +++ b/net/ipv4/gre_demux.c @@ -60,7 +60,9 @@ int gre_del_protocol(const struct gre_pr } EXPORT_SYMBOL_GPL(gre_del_protocol); -/* Fills in tpi and returns header length to be pulled. */ +/* Fills in tpi and returns header length to be pulled. + * Note that caller must use pskb_may_pull() before pulling GRE header. + */ int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi, bool *csum_err, __be16 proto, int nhs) { @@ -114,8 +116,14 @@ int gre_parse_header(struct sk_buff *skb * - When dealing with WCCPv2, Skip extra 4 bytes in GRE header */ if (greh->flags == 0 && tpi->proto == htons(ETH_P_WCCP)) { + u8 _val, *val; + + val = skb_header_pointer(skb, nhs + hdr_len, + sizeof(_val), &_val); + if (!val) + return -EINVAL; tpi->proto = proto; - if ((*(u8 *)options & 0xF0) != 0x40) + if ((*val & 0xF0) != 0x40) hdr_len += 4; } tpi->hdr_len = hdr_len;