Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5669685imu; Mon, 26 Nov 2018 03:49:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/VsqApDRH7jW+HklY3dMPw3CYTCOagddY8WxfOSHAjCq7FZcb3WXgLtolXgyKEOcWAUd/z+ X-Received: by 2002:a17:902:a58a:: with SMTP id az10mr28143428plb.151.1543232975688; Mon, 26 Nov 2018 03:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543232975; cv=none; d=google.com; s=arc-20160816; b=GsxZAEQvIMOLcYWycXJ10ZTvF0+tRtHqTcibitK9TRaiRfG8IxOStT0nHi0DB+1N7P FtXDpgTL5kTz8PbNquQS2nyFZbaW4sUQDw3qxoz2HZe+68Fzm6Yz4FU8ATlane0V4r5O Dt5g0IKefrcgXPBZ/YkjyJZdB/NkY/saBiohqB4okOFfbvHTLf9Fk0U9laruX7xsfhPo KQ7SWrgb5WnZGeXUHeRUIUibnL3DP+794ZIgEFG7P3QvmnZ6FSAaesXg37VHeJvAxxTt ZdoqFQ1h52IJLko8qzaNDbzoh5PO06vRIPmsyZ93yU/mxWwrYvKUG85FDwfMUS3ooLwX BdsQ== 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=04G7VglFcyPtHt2mWQ/W0HXAQk2xxun4D1v6+1+6uQg=; b=dSQk5EKv1fIgfeGiH4y+IIgbgsDdEuExySNvdaLiF4xsAweefkgYxxbpTzpgbKWNpw ClpRkK/ujTfZVA3hM4i7DsK+dpehj7AxKGx9uQ7+77ZV+MTwuYmci1uFN3FAntToCHRE F7+Pek0GxDp2sUak2KsLyIx8pgIjDFCzCKQih19mhl2av3xaNkH55WTukrGdmLNxJcVq pe0qd4Qj9gmQ+tCElAVIroHpmu3LJnzpOK470Aw7sfiuuFpea4cuQIwh1A4+sXCpEZtZ SZ+lvObCYPCpaX4B7M++bbI2cbxsneA6PjU5R5qN1tAnSNxkcaHOAxXxHuMB0nzzgcly ZirA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PWpSfOXQ; 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 r27si58075pgl.494.2018.11.26.03.49.17; Mon, 26 Nov 2018 03:49:35 -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=PWpSfOXQ; 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 S1729608AbeKZVx0 (ORCPT + 99 others); Mon, 26 Nov 2018 16:53:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:35170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728810AbeKZVxZ (ORCPT ); Mon, 26 Nov 2018 16:53:25 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 76C8420817; Mon, 26 Nov 2018 10:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229981; bh=AxCWt5A1p+y5PYxZfiNTjGbV6vwI2p1XGyDS0BPkhdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PWpSfOXQQdtmvFyQ9tfvavRK9x4zUQdo7qUSAvLO0PM12PmZB/iBh+00m2eP8uLZl kQfPnBFA3YSHVoaZc5s65bCW4VqvvDJNY9FC3htMOHE8h76n+XTCnUe1oiZfDA2i+Q zPbh6+wBhh4c7qgEtUmP6PpCrcwiGhlHks5jNTuE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 26/62] s390/qeth: fix HiperSockets sniffer Date: Mon, 26 Nov 2018 11:51:07 +0100 Message-Id: <20181126105052.929862832@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105050.592727680@linuxfoundation.org> References: <20181126105050.592727680@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit bd74a7f9cc033cf4d405788f80292268987dc0c5 ] Sniffing mode for L3 HiperSockets requires that no IP addresses are registered with the HW. The preferred way to achieve this is for userspace to delete all the IPs on the interface. But qeth is expected to also tolerate a configuration where that is not the case, by skipping the IP registration when in sniffer mode. Since commit 5f78e29ceebf ("qeth: optimize IP handling in rx_mode callback") reworked the IP registration logic in the L3 subdriver, this no longer works. When the qeth device is set online, qeth_l3_recover_ip() now unconditionally registers all unicast addresses from our internal IP table. While we could fix this particular problem by skipping qeth_l3_recover_ip() on a sniffer device, the more future-proof change is to skip the IP address registration at the lowest level. This way we a) catch any future code path that attempts to register an IP address without considering the sniffer scenario, and b) continue to build up our internal IP table, so that if sniffer mode is switched off later we can operate just like normal. Fixes: 5f78e29ceebf ("qeth: optimize IP handling in rx_mode callback") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/s390/net/qeth_l3_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index cd73172bff47..a19f2dc69e8a 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -358,9 +358,6 @@ static void qeth_l3_clear_ip_htable(struct qeth_card *card, int recover) QETH_CARD_TEXT(card, 4, "clearip"); - if (recover && card->options.sniffer) - return; - spin_lock_bh(&card->ip_lock); hash_for_each_safe(card->ip_htable, i, tmp, addr, hnode) { @@ -818,6 +815,8 @@ static int qeth_l3_register_addr_entry(struct qeth_card *card, int rc = 0; int cnt = 3; + if (card->options.sniffer) + return 0; if (addr->proto == QETH_PROT_IPV4) { QETH_CARD_TEXT(card, 2, "setaddr4"); @@ -853,6 +852,9 @@ static int qeth_l3_deregister_addr_entry(struct qeth_card *card, { int rc = 0; + if (card->options.sniffer) + return 0; + if (addr->proto == QETH_PROT_IPV4) { QETH_CARD_TEXT(card, 2, "deladdr4"); QETH_CARD_HEX(card, 3, &addr->u.a4.addr, sizeof(int)); -- 2.17.1