Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4165650ybe; Mon, 9 Sep 2019 05:24:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJEu+yfbyNAUZRqs8cnN6mxRpnttw7PUHxqLCnFTeJ+85E94f3ueTmmkj5nBUlXX+9lGcd X-Received: by 2002:a17:906:d9d9:: with SMTP id qk25mr19810976ejb.275.1568031874299; Mon, 09 Sep 2019 05:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568031874; cv=none; d=google.com; s=arc-20160816; b=mMgQawHb8aQKafSWxCn8+0+ZGNE7uWGLyezzJfOD4fuIPzQEBUpUqMIyrWvaSJP3dN LhW0PF86WyBrLMfF7laAwJ0AHEE8QZfhTwM6zt3puYMF5HZK62xZ2DDiWds2HKqmdHZt 8X3mb0o15OtC4WAkHnea8zKrh64zNlXgvMRcoZYBOOZqYXw+GReGuOwdo/WKtuh3dKFO bwRlAGFb4FjvX6le0FawiohWM7HVON+8GESFC5EA7m+8cdFl8nvobnPBbpjFONCmNonl otvK1DYP0LKJTomokzHoOWxcA5eD7sGPJheiYUiT06hepkult+K68JvHvs2o7BQOtF90 wtyQ== 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=Qzl+nUEkTMHEUFRsUF6GqObM16uLd4eBhJ20iQswNoc=; b=BRcJWG2iENLQ0XyLYxX4L8p9xhUytqx59wjHVUxcCYhMo0N8AMtOeBvElrbpJvIAqO rpH8iYWs+wBD78aGyUPh7IkgLANcQDfl/u+AUnPeJ5++lIv3OnWf2QuklHMlqo23Zj/f 1P5HxzUzDCcAZwgHCR6PkH6vZ9Tm5zst1VlQP4eEQdrCoWpmDYtjwR686OpCbCKSzlR+ +vxcGDiCQXFUAUgIjuhBlOP3xDEa7Ksz+NITcd8a/skA1tiZBWCAX/pCCThgck1BuhRV hndWcKiFz6BiFv6jTkHrXnZrb3F7x0q4j3a33+1dlxOaUT5HHmlbqMPdfNFtlPUmsmn9 iq3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zmqq5yoe; 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 h8si7590567ejf.254.2019.09.09.05.24.07; Mon, 09 Sep 2019 05:24:34 -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=Zmqq5yoe; 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 S1726719AbfIHM6K (ORCPT + 99 others); Sun, 8 Sep 2019 08:58:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:35670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730658AbfIHMrW (ORCPT ); Sun, 8 Sep 2019 08:47:22 -0400 Received: from localhost (unknown [62.28.240.114]) (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 6505D218AC; Sun, 8 Sep 2019 12:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946841; bh=ulD0vVxQlhyjPEc/rD8TYddeF/qBdx2S7MVaT/wMcTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zmqq5yoe+f8j1ZnJimdMXMfgUWxJEdonf3pdrhZRsX8Xmr2xNSpttdW0xUItuaQuZ 5d8UYSOFPSb5qTQXZ8QU5sPvdMzbJrp6Fe1z8f5Wwa78msj0nqDFY8SPykwFfMy7ZM k0z6sF7Zx1sisUq4SzMSaEL5wqs79qQ6eb6A01Po= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangbin Liu , Thomas Falcon , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 20/57] ibmveth: Convert multicast list size for little-endian system Date: Sun, 8 Sep 2019 13:41:44 +0100 Message-Id: <20190908121134.287965367@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@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 [ Upstream commit 66cf4710b23ab2adda11155684a2c8826f4fe732 ] The ibm,mac-address-filters property defines the maximum number of addresses the hypervisor's multicast filter list can support. It is encoded as a big-endian integer in the OF device tree, but the virtual ethernet driver does not convert it for use by little-endian systems. As a result, the driver is not behaving as it should on affected systems when a large number of multicast addresses are assigned to the device. Reported-by: Hangbin Liu Signed-off-by: Thomas Falcon Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmveth.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index f70cb4d3c6846..40ad1e5032553 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -1618,7 +1618,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) struct net_device *netdev; struct ibmveth_adapter *adapter; unsigned char *mac_addr_p; - unsigned int *mcastFilterSize_p; + __be32 *mcastFilterSize_p; long ret; unsigned long ret_attr; @@ -1640,8 +1640,9 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) return -EINVAL; } - mcastFilterSize_p = (unsigned int *)vio_get_attribute(dev, - VETH_MCAST_FILTER_SIZE, NULL); + mcastFilterSize_p = (__be32 *)vio_get_attribute(dev, + VETH_MCAST_FILTER_SIZE, + NULL); if (!mcastFilterSize_p) { dev_err(&dev->dev, "Can't find VETH_MCAST_FILTER_SIZE " "attribute\n"); @@ -1658,7 +1659,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id) adapter->vdev = dev; adapter->netdev = netdev; - adapter->mcastFilterSize = *mcastFilterSize_p; + adapter->mcastFilterSize = be32_to_cpu(*mcastFilterSize_p); adapter->pool_config = 0; netif_napi_add(netdev, &adapter->napi, ibmveth_poll, 16); -- 2.20.1