Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3485988imu; Sun, 11 Nov 2018 16:10:56 -0800 (PST) X-Google-Smtp-Source: AJdET5cG6XVaV8AL4aHKkilwgcqNAqu+Wac6srg+KrwS6eu7M7uusJzp/sFPD1a6g1OvBwNjIozo X-Received: by 2002:a17:902:15a8:: with SMTP id m37-v6mr17812871pla.256.1541981456080; Sun, 11 Nov 2018 16:10:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981456; cv=none; d=google.com; s=arc-20160816; b=SGzF7npgDMvqPKHzdVJFOde/mrO+MkrbGZFYFMEbvENV/l0DpMLHuVlNUCvF/9YmcJ dMX29/u75inYVzNj8KgTHV6L8fzipd/mwM9cjStmVj9mJ7l3JDR5JktHG2ZfgjOFm2UD /gp5uN/vi3Gf0DQy45WOfZav6RkCSresAc++vlHK/M/p/1wuSTlro1W7ElPpso8iWfQK rQuSsMDaljOA0ah5LE2d/Vjva6rdUVqkTbjA5BaWNvXvPJ2FXJqDiviafgcUh40ohjcu 84MDT/eQ5LjbnwOEjC+cCPJezoE3ASh2ssJaZjJgDTsWJLqQ51d83/aXzA+8o8ekLLcP QjAw== 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=gmZXfV+znUDoq6s7XM6sJgU3ZVZiG/Ezw2k/WAE1yYc=; b=qhlgbMC/0tNM1xJk6SzQHMcaLbBUC9MfVmONz8UML6ZCl6qLQxfkCCiaC0DXJ/1YAi 4nnQ0QEvruggvEQt8kYNyBEShPrqtccXcKPRpqe3lkF9I4+XO24XVWXunRgHz0to6Ow9 qU+v2qjAzwQ7QTd+t6hnZVo8Gue4egp58uEAilr1TDb3kzCNebqiKkFJ8ZJ5INsCr1x/ aYSndWGo2tvadrR9bDdjeaMdexQ9CU5Q0yH1slWTEzvNh49hhDq2pr0i3RCalCSLVmkU JzdgN/ipT3akmPJDN6HJA3TpAPI3xhm0OpbnsSWHw2wsklhpEYF6baJJ2AO0FjVQSquv ih4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=INe9R6J4; 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 g13-v6si15349657pfh.229.2018.11.11.16.10.41; Sun, 11 Nov 2018 16:10:56 -0800 (PST) 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=INe9R6J4; 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 S1731639AbeKLJ7f (ORCPT + 99 others); Mon, 12 Nov 2018 04:59:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:60278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731081AbeKLIR3 (ORCPT ); Mon, 12 Nov 2018 03:17:29 -0500 Received: from localhost (unknown [206.108.79.134]) (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 E17CE214E0; Sun, 11 Nov 2018 22:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975253; bh=CCzxzbPyMAAOKeeO4ZqUxRoWQx882FITFFQF+lJP94A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=INe9R6J40b1njn2N9NN+B6F2woLxJYNchMpHdzl2KLG2FfQOFlyJ5cQwKk48qkFdv YI6sWLfLosa9D5ewvT9YtKipcB3/5rAVax4MvOzhnPieLjc7cPRNf06GpI3C+wopfs bSDJ/zmOWDJLLhvnVcOuaxSumsGtbYRBgYiT+fKE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shannon Nelson , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.19 123/361] ixgbe: disallow IPsec Tx offload when in SR-IOV mode Date: Sun, 11 Nov 2018 14:17:50 -0800 Message-Id: <20181111221637.329600549@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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: Shannon Nelson [ Upstream commit 47b6f50077e68bcd544f657526dad4bfdce7e87d ] There seems to be a problem in the x540's internal switch wherein if SR-IOV mode is enabled and an offloaded IPsec packet is sent to a local VF, the packet is silently dropped. This might never be a problem as it is somewhat a corner case, but if someone happens to be using IPsec offload from the PF to a VF that just happens to get migrated to the local box, communication will mysteriously fail. Not good. A simple way to protect from this is to simply not allow any IPsec offloads for outgoing packets when num_vfs != 0. This doesn't help any offloads that were created before SR-IOV was enabled, but we'll get to that later. Signed-off-by: Shannon Nelson Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c @@ -676,6 +676,9 @@ static int ixgbe_ipsec_add_sa(struct xfr } else { struct tx_sa tsa; + if (adapter->num_vfs) + return -EOPNOTSUPP; + /* find the first unused index */ ret = ixgbe_ipsec_find_empty_idx(ipsec, false); if (ret < 0) {