Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6236997ybe; Tue, 17 Sep 2019 23:33:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOB386TVxa2eIVInzdAUayYkeptEsuZiObXuWdm7zL/17Jsm6LqsRc71e5LqW+vh/Z/jvL X-Received: by 2002:a05:6402:651:: with SMTP id u17mr8702531edx.59.1568788383131; Tue, 17 Sep 2019 23:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568788383; cv=none; d=google.com; s=arc-20160816; b=OE7GTs8/ogVbAdKjpAhO3ZNZaIyTDciqC/CDycQMrqw1fN8mj4OlKWowc08ZD2UsK3 bFILivIfejezu8dKvmurcrT22kWFec20tEiDENUi3rA+ZKbVsWwVFYDSdosb2gXXM6c/ wkB2m/Qgt7vGuF/uHJYWxbZ1MCzPjIAYSr89RHNf7f8v34gCmo16Fn+ZYYtfNAnjZyJy WcrYQ0JiDpQ99eWhCNGgFmoIt6WEubJQUxlcMpg2Wb9nW4pvvoRqmWrzQxWSsRYyQrjj 6Ty+UftGs+FNslPe9BY1C1rwbiKmh7hkftD8uUz5tDdZskedhMJ5VS+Xg4fjJK7dH+PP Zphw== 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=2K7vNhcSWiawHf+HuRzndYEpJDLuLrbDPZeozIZ4sPA=; b=Tkzcs/tt/kGTT6KMJtwBD+81+C42LNg/I2CxLs9LIuUvfVP2febHbamGtnnB6W+KTI YTXqQVdaaRSbXP1eKhpIkrioSXKZMSza+3y0UXwqjQbCvDaDxTcLn8S+2N0vFPEXSTdx ibv0qYh9HOKZ9dzTkPds64DsdAVLHV/cPwUrEK4UfbBnbtg9JBFT8kOxUU5r6OtP+MRT uATDFd5GUbmytins0U6sTS9K/PxpAG+11zO2hx5OpEqjwrvH6Bv+J7DvI6uRsz9i2JgC 0WeyoxnGFhUA+5Fjs/5ugvL6+0nwp9hx+8B1mY+nymiYhsi06uVdYrOmtefoEzvoxDQH WMhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xYgRxwhw; 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 d9si2814581edb.371.2019.09.17.23.32.39; Tue, 17 Sep 2019 23:33:03 -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=xYgRxwhw; 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 S1730153AbfIRG3o (ORCPT + 99 others); Wed, 18 Sep 2019 02:29:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:46740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbfIRGZl (ORCPT ); Wed, 18 Sep 2019 02:25:41 -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 3A68B21906; Wed, 18 Sep 2019 06:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568787940; bh=JFk5Jv4dKcXIkrB4AdcywhjcbvMFMjIgV59Vz693O0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xYgRxwhwg7PUGcDe+awqw+npdhnqEimfBi5JKaGau3vYbNYr/NrSVI4aCE6Alpl9K 8Kgjwa8WfXLWFDVm5l8O2eI/dr+zfl7QqmM3ucqWVgmoPM7Mn46FOEggqjGsmBOb30 XBB/LjkLdBreNme4N6SvQMsCxQ8NGeYWXTgNdRAQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Marley , Steffen Klassert , "David S. Miller" Subject: [PATCH 5.2 05/85] ixgbe: Fix secpath usage for IPsec TX offload. Date: Wed, 18 Sep 2019 08:18:23 +0200 Message-Id: <20190918061234.300610892@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190918061234.107708857@linuxfoundation.org> References: <20190918061234.107708857@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: Steffen Klassert [ Upstream commit f39b683d35dfa93a58f1b400a8ec0ff81296b37c ] The ixgbe driver currently does IPsec TX offloading based on an existing secpath. However, the secpath can also come from the RX side, in this case it is misinterpreted for TX offload and the packets are dropped with a "bad sa_idx" error. Fix this by using the xfrm_offload() function to test for TX offload. Fixes: 592594704761 ("ixgbe: process the Tx ipsec offload") Reported-by: Michael Marley Signed-off-by: Steffen Klassert Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "ixgbe.h" #include "ixgbe_common.h" @@ -8691,7 +8692,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct #endif /* IXGBE_FCOE */ #ifdef CONFIG_IXGBE_IPSEC - if (secpath_exists(skb) && + if (xfrm_offload(skb) && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx)) goto out_drop; #endif