Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp385576pxk; Wed, 2 Sep 2020 04:20:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ/tB9v1SIugE7zt42ESu6fD78JM9VIuqJoP8mTec2F9uDXwA51nbvH4zY7doRWMZhEBlU X-Received: by 2002:aa7:c7c1:: with SMTP id o1mr6289189eds.368.1599045611469; Wed, 02 Sep 2020 04:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599045611; cv=none; d=google.com; s=arc-20160816; b=sMr1LGmtJFQYyBu0ogs62EiYDYP3dGZAi0NiBtrs3ThsGVLTnyJPrZu8TEp8ANNebt jghagTLLgxaPYMuUmmVVcEQFwgNVXabsyOFeuDs1ASNfDBymeOsptrbzR5r+rltd7GpG Kciv96VmRMuIU9T4chp/clBrdJGxiNKH1KSa9soh9xQj5UhBRblYTQ1lrzoS6RBD+iWL 4trsFdd6V3RJm7Hp1s1Z0y2NLlOx4g7XHUuV7GrbB90asQ4lKV8BpN7sNdDQ0bk9NbBs tk2Xs3g9J4btYYmc9cvPhoGgCjNoOIutQAy1QmxVvJ+xw2eVaf2dlK9lwJ1JhPTB/kfx srrQ== 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 :message-id:date:subject:cc:to:from; bh=sIqApshDOtTxlo5FK8DhBC+GEPu//rVe7EZe6AlqDB0=; b=NZGCtRZ591kjCqVKCjHx2gA2akAQJfG9wi80MrRwlIkkABW17T9pQ/7yM2vYKXrZaW NS5ls4fnCSWH6lBzFjGMbve/5T/eKsMBs1dypGCXas3O2ENwsaQV7WPjwy6rXtL9rUMD gnxYMFXsIQ/nPNr0w1dwxFlFrT8BXHP7QYOwcy4NTSVqKn90KX+x2LEkUadD2wed3oyd Q31tcDyrP+8xbK/YgI4pS/FtEbcOta+idUcxr9yxDLBuvRF311dLL2PU9NONTMW1MTFi cx6Zxg1+dIvaf9cijWdMP74qnm3fePMD4PHCW8AQJIjNVC2ZZ52+HZMusImDAs5sD1zv kvJQ== ARC-Authentication-Results: i=1; mx.google.com; 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 z1si2373631eji.189.2020.09.02.04.19.47; Wed, 02 Sep 2020 04:20:11 -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; 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 S1726521AbgIBLTR (ORCPT + 99 others); Wed, 2 Sep 2020 07:19:17 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46032 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbgIBLTN (ORCPT ); Wed, 2 Sep 2020 07:19:13 -0400 Received: by mail-lj1-f196.google.com with SMTP id c2so5373430ljj.12; Wed, 02 Sep 2020 04:19:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sIqApshDOtTxlo5FK8DhBC+GEPu//rVe7EZe6AlqDB0=; b=mXfRi7nPl2saIhJRyJ0d888xpn6ibcJVbojEc+k2Ap9MyLEnY0oFxzknNNB0i2LaIx NdXrnFRTi3PpMaJcnEMiilmrp+QxTNyj3fQI6JUWxT5SrBe0oGKpLPR4w4bJ1ClBA86T wrSgBt4CDoLxt1StCZbf2Uv/fProBV+ZKuADX5RR6H1w/muUNZZ7B4QTVJFIywTbhIGH PyL7LRmiGWGMSSTZZ/+MS0lT+Eyee7bjfzD81FybkKt52IWjKqSd5Hs5Z0BQUUMf/hmi ckEL15CsbfOnp+QfC2JH2/jbN79hQCi0aOEVQrpUr3hBR0o0AIe97/6ZX05+QfRUp3cP tDTg== X-Gm-Message-State: AOAM532PaR0nsDLf7JDMlqlqCI8icuaV89x2XhYLwx4za64+QTLQpVCs kFvRpqTo7C3DPw6Mj7asBK8anv6NExM= X-Received: by 2002:a2e:91d2:: with SMTP id u18mr3039908ljg.436.1599045550650; Wed, 02 Sep 2020 04:19:10 -0700 (PDT) Received: from localhost.localdomain (broadband-37-110-38-130.ip.moscow.rt.ru. [37.110.38.130]) by smtp.googlemail.com with ESMTPSA id n62sm465066lfa.82.2020.09.02.04.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 04:19:09 -0700 (PDT) From: Denis Efremov To: Doug Berger Cc: Denis Efremov , Florian Fainelli , "David S. Miller" , Jakub Kicinski , bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] net: bcmgenet: fix mask check in bcmgenet_validate_flow() Date: Wed, 2 Sep 2020 14:18:45 +0300 Message-Id: <20200902111845.9915-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VALIDATE_MASK(eth_mask->h_source) is checked twice in a row in bcmgenet_validate_flow(). Add VALIDATE_MASK(eth_mask->h_dest) instead. Fixes: 3e370952287c ("net: bcmgenet: add support for ethtool rxnfc flows") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov --- I'm not sure that h_dest check is required here, it's only my guess. Compile tested only. drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 0ca8436d2e9d..be85dad2e3bc 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1364,7 +1364,7 @@ static int bcmgenet_validate_flow(struct net_device *dev, case ETHER_FLOW: eth_mask = &cmd->fs.m_u.ether_spec; /* don't allow mask which isn't valid */ - if (VALIDATE_MASK(eth_mask->h_source) || + if (VALIDATE_MASK(eth_mask->h_dest) || VALIDATE_MASK(eth_mask->h_source) || VALIDATE_MASK(eth_mask->h_proto)) { netdev_err(dev, "rxnfc: Unsupported mask\n"); -- 2.26.2