Message ID | 20200319123938.305603077@linuxfoundation.org |
---|---|
State | Superseded |
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, USER_AGENT_GIT autolearn=ham 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 3A045C4332E for <stable@archiver.kernel.org>; Thu, 19 Mar 2020 13:24:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1317D207FC for <stable@archiver.kernel.org>; Thu, 19 Mar 2020 13:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584624261; bh=KHwXrlKcbaKW5OTF2R6Sp4xIzaqTtcNI8e891CLiBoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=s5MopdLVtd58zHT2iGFk+4YpuWVPZFPCBvKa4U4Iq/CtHBmi1SemZzLuq/xqZMid3 LkHn2NTf3Ets6sdzzvwfdXxtGxu9n3YYiu+7vsbB2NcuYtJ4rYs1sqI6ePqYm5FRi8 5Ehc5zsXaosicLnapeEmv8Yod1PQQ5hjVq84v7QU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730211AbgCSNYU (ORCPT <rfc822;stable@archiver.kernel.org>); Thu, 19 Mar 2020 09:24:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:50914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730442AbgCSNYR (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 19 Mar 2020 09:24:17 -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 A79A420724; Thu, 19 Mar 2020 13:24:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584624257; bh=KHwXrlKcbaKW5OTF2R6Sp4xIzaqTtcNI8e891CLiBoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OcZuTJIaNnayyTZR/6xH3ZFegckG4G2d6rrv/mlb0Vu1B3v3wOoKFCcMReoNOIgVo ObVJ5PyxkJVkSL9rVle5UDcbZxra6+rjqL1KCSj6+dBVD26iiSVZnMgIlzWAD5bkA/ UAjXoLSBN1EahW0i7Z7YStDWDxpChcAeTjGNHzrk= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Guillaume Nault <gnault@redhat.com>, Matteo Croce <mcroce@redhat.com>, Paul Moore <paul@paul-moore.com>, "David S. Miller" <davem@davemloft.net> Subject: [PATCH 5.4 60/60] ipv4: ensure rcu_read_lock() in cipso_v4_error() Date: Thu, 19 Mar 2020 14:04:38 +0100 Message-Id: <20200319123938.305603077@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123919.441695203@linuxfoundation.org> References: <20200319123919.441695203@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/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c @@ -1724,6 +1724,7 @@ void cipso_v4_error(struct sk_buff *skb, { unsigned char optbuf[sizeof(struct ip_options) + 40]; struct ip_options *opt = (struct ip_options *)optbuf; + int res; if (ip_hdr(skb)->protocol == IPPROTO_ICMP || error != -EACCES) return; @@ -1735,7 +1736,11 @@ void cipso_v4_error(struct sk_buff *skb, memset(opt, 0, sizeof(struct ip_options)); opt->optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr); - if (__ip_options_compile(dev_net(skb->dev), opt, skb, NULL)) + rcu_read_lock(); + res = __ip_options_compile(dev_net(skb->dev), opt, skb, NULL); + rcu_read_unlock(); + + if (res) return; if (gateway)