Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp668927ybg; Mon, 1 Jun 2020 11:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5gJTn6t8W2MDoDa2LRwA3/cG5pUWrT2CZMb6MD8NKrWVvb4VlSXA7/36Ib6eHsqTv8+Kw X-Received: by 2002:a05:6402:1812:: with SMTP id g18mr3868886edy.96.1591035206342; Mon, 01 Jun 2020 11:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591035206; cv=none; d=google.com; s=arc-20160816; b=WanrfuLomB72EtoeJaO/GVm9T57PbBk8GeunywlijsJXm2VyBSfuMl41xQi75oPV4m g/Z99cJTiA413rLqxrdxBw7j3CXpAN5Y0p6iiv+fBvLQHRgCtiPm71+Dvj942uYtJBhc QDBSq780H721ycIlB6gQlvGFUuMbkqc/SUrePV7ZXZ9dQDTsJA8+AOc/qHq5oAOkK3Ni CpX/4O1yiRfsoAwBBL1cKJXt4I7l41b8kx0hNSEU5QEIVop90o6ymhWeAIz1P0GNYDK5 UMPBY4kvkDhnKYmD/lWgBfybgFVB9SlktSJsXD6jG7ytmXX4x1ERSo6JJIEKgr3lFM3w z0Sw== 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=Sf/MpScAbAdLAja2FjiUv6+xVDnPeapUzpT083qQZCc=; b=ImV1pGyYY7MjvLD23Z7l/IeeUTu1GFNkOhzNEhreXmzGt/x3aiP+Fd0InGdj3fgxdS zTFjsxL0Xd15RcBXUQJu9pFkTmajLYF30Xq1dMKnLqDs3C31GS/GxkrBc1mA0iqlk1JK +56wEuixRwhh/d5dRUcq+IONIXevum+0D+jHVj32EIWy0xBje6lsEFnb9YfWa5CKwY+M Ilrm68ydBHborfwhcMpNBCer0BroiM8/xi320Ud6VzUln2x7g2X8Mcy7MPl1fxm/t4JS aWecORIBksZ4xn3zA/SbPZ8MElgYS5mAtpbzHBhA4lBrLLNz6d5Z6kj+2ixHQG7SRHcs mNSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RIJGtJ8A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gr2si129211ejb.221.2020.06.01.11.13.02; Mon, 01 Jun 2020 11:13:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RIJGtJ8A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730994AbgFASK3 (ORCPT + 99 others); Mon, 1 Jun 2020 14:10:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:56898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730966AbgFASKN (ORCPT ); Mon, 1 Jun 2020 14: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 C800A2077D; Mon, 1 Jun 2020 18:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591035013; bh=jMoiX+JGTBCMU7QJU91KJpkrlSuZHrgN8R4EYldhycg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RIJGtJ8A0xhUzNsiwKPGMfZtGY1+MoJfcjRjCtK13Bg8YsL6lw0uBaIjzQvTb9BwL /G0bLdaqNFoJagFKamzEoyLTBiVxHj7tMS2AzKEWul+oHGe58UtN0QjlHrEBs98Twp 8+v5R8fqLS17cKGWG0/HMPQHYuQU2N1oLO9IxQfs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xin Long , Steffen Klassert Subject: [PATCH 5.4 114/142] xfrm: remove the xfrm_state_put call becofe going to out_reset Date: Mon, 1 Jun 2020 19:54:32 +0200 Message-Id: <20200601174049.692855504@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174037.904070960@linuxfoundation.org> References: <20200601174037.904070960@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Xin Long commit db87668ad1e4917cfe04e217307ba6ed9390716e upstream. This xfrm_state_put call in esp4/6_gro_receive() will cause double put for state, as in out_reset path secpath_reset() will put all states set in skb sec_path. So fix it by simply remove the xfrm_state_put call. Fixes: 6ed69184ed9c ("xfrm: Reset secpath in xfrm failure") Signed-off-by: Xin Long Signed-off-by: Steffen Klassert Signed-off-by: Greg Kroah-Hartman --- net/ipv4/esp4_offload.c | 4 +--- net/ipv6/esp6_offload.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) --- a/net/ipv4/esp4_offload.c +++ b/net/ipv4/esp4_offload.c @@ -63,10 +63,8 @@ static struct sk_buff *esp4_gro_receive( sp->olen++; xo = xfrm_offload(skb); - if (!xo) { - xfrm_state_put(x); + if (!xo) goto out_reset; - } } xo->flags |= XFRM_GRO; --- a/net/ipv6/esp6_offload.c +++ b/net/ipv6/esp6_offload.c @@ -85,10 +85,8 @@ static struct sk_buff *esp6_gro_receive( sp->olen++; xo = xfrm_offload(skb); - if (!xo) { - xfrm_state_put(x); + if (!xo) goto out_reset; - } } xo->flags |= XFRM_GRO;