Received: by 10.213.65.68 with SMTP id h4csp1688290imn; Mon, 19 Mar 2018 10:35:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELtxPsx6ic5epgnvrn61rLcg9Oxu6FDrb5D3hzUCEEDUMrL61s/V8l7fZUurOu6P6Fg7yqLZ X-Received: by 2002:a17:902:b786:: with SMTP id e6-v6mr13606877pls.58.1521480931671; Mon, 19 Mar 2018 10:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521480931; cv=none; d=google.com; s=arc-20160816; b=1FYZlUf6qOsGy2SbckP6hZIYEfo/LxZOKcx3YJ/9ddFh+NscJB1RD3tH6WxQbEgw0s vlHiAD6EMlDnHcUMWDz17g5ALGTgziQ43wCL9PE44OgyCX9BN1s4UqBqiKGxGpevGyks UhV6eCtkplwsBT0A9b3tEFqZ9CcuZFjB0IBH65yJXzPJpKAZnHKk3/kBKwnIimqY7kii OXOd+c0LvbFreK/cGO3UDC57wq1Js4ahVeKLBwu/MHhhIZw+KwyI04R/z2AvB+4m3cgM RqQoKKJP/31jL3bUXRqCa8EMhADsE0b9UwPJ+GhlBPc21r8mYeD4GR5z7c5ysUMjDsWs XeIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=5RcC42xmh1WJJYrlQDaJLa8/l3dDkZkCxZ0bouaQaJ8=; b=oSDLR/jruPrCCYl4DUVUPeF0HG09dgzYWUPz16VS2iiIO8JHJ7dSD+cr03cBfmqOka 2EdbtCm79oJ6l5LUSBICpZrg0QtI7v0TRcOD+T44E3mMAewLks0gmMdThZgtkwvdafDB DpmX4uoPVBmDuIvdAclAakoiowD8VSV/cVWu5KfM/gB8s2GyfDU3vxqqWVkytY7rAghY BENMc8KOxsnSwxeo9RPJpxVWK98arg62T5KfUvDR7LRh49lTxL5uS4VyJAMGfUv5SQIR aYLrMoTPj1ZPkCTkY0vlOWe0KYOrsCWNIApSJGtEA9y5tAO6ilf4z6hPG8Xu5+qlefBB 2tYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Lpv8jYUn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si356297plk.52.2018.03.19.10.35.17; Mon, 19 Mar 2018 10:35:31 -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=@microsoft.com header.s=selector1 header.b=Lpv8jYUn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967023AbeCSRdn (ORCPT + 99 others); Mon, 19 Mar 2018 13:33:43 -0400 Received: from mail-cys01nam02on0100.outbound.protection.outlook.com ([104.47.37.100]:20505 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965952AbeCSQGw (ORCPT ); Mon, 19 Mar 2018 12:06:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5RcC42xmh1WJJYrlQDaJLa8/l3dDkZkCxZ0bouaQaJ8=; b=Lpv8jYUnoR65DGCix8cTFe4VtyHkxwzL/Vgbsef/B7ysJxCKHQ6p+BwrX484HEIAcNVIUfo/1Yap79UpydAkhbbn96Mb64ryXlgGTuFvEpS9k2hXjB38kbi++sOgpde3oAqnD0sppB0HvPLy0ADBvMoUN5e5qZSeDjCBEV6NtLw= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1093.namprd21.prod.outlook.com (52.132.130.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 16:06:49 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 16:06:49 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Talat Batheesh , Tariq Toukan , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 018/167] net/mlx4_en: Avoid adding steering rules with invalid ring Thread-Topic: [PATCH AUTOSEL for 4.4 018/167] net/mlx4_en: Avoid adding steering rules with invalid ring Thread-Index: AQHTv5wi0XNbCV/oMEWJDD9eSMqJqA== Date: Mon, 19 Mar 2018 16:05:44 +0000 Message-ID: <20180319160513.16384-18-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1093;7:+wbXAfqC9UYiGLAPOSgCmRGF+U1XbEm5r59D+vsaOb5LdUEFNLLR3t4+3V384HGv/CLuwUSPT3vaTljCNZS0xE4etrg3uKMaBdCad9sK6uPDRm18ikqw6CoZ4bHKk8skUAzS+mEsi3Mpju7JhSURIKLYPQqs8l31t04JmVUR/g2p7s8rd/H2D2jdzkDFEKZsU9+IShKoLVTy0fEDM1C+XNmUgBRyseO7gJPuUD5Q01gt0vzhLWjAbTGB/ZGbcJrp;20:1J84JYLpWAXw/FKUN50LaArP0JYIrJx+TUADYVDsqS1pg1rB5RvFiFFojRrMw32PAl5dejZ9+iwJlaqvP8oN3L6MNymKB1rlChY1mKQPXl8NuFvlotHFGXSZ3rcziDznjzhDRHzRvsdczv/FPU+xN8hj4lnJ0y8PMiS0l6RX6nQ= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 8af49d36-479d-4dc6-ac21-08d58db36bd1 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1093; x-ms-traffictypediagnostic: DM5PR2101MB1093: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1093;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1093; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(396003)(39380400002)(366004)(39860400002)(346002)(189003)(199004)(10290500003)(68736007)(478600001)(110136005)(72206003)(36756003)(99286004)(97736004)(10090500001)(305945005)(7736002)(6666003)(76176011)(107886003)(2950100002)(6436002)(86612001)(6486002)(4326008)(54906003)(186003)(3660700001)(25786009)(26005)(2906002)(53936002)(5250100002)(2501003)(81166006)(81156014)(2900100001)(86362001)(5660300001)(8936002)(1076002)(8676002)(3846002)(5890100001)(3280700002)(6116002)(66066001)(316002)(6506007)(14454004)(106356001)(6512007)(22452003)(105586002)(102836004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1093;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: KJNftOR2D+uuziyncrYGzk+KEP98HMj31iWrEWRz+t3iTMO2nuezyfThBI3dwoamN/XbXDbZHh23DAfo7ZAZQ/58FVJX7JB/Pwsxv4v4VzbAX/QQJOzTvsnCLO/QAj2r4A3t2x1fBZNw85XbQF2LgI4V39h3nBUgAkRyLSPhU+ODbK7Ij80y3tLifYKrb1C5aryFHuRmpN+OrjAaLPParZXmPBdEZuZA1vRQ+XHQSQRqNX3nV27TFAO0E5P3exAxXTDWZ5SunTUs3In8edd1sKg00oyKDK4BRj7cOVpg+xhNStYQTjdK7bPBZ35g2fDXwElD2XKmMHBMqQFWjOLVig== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8af49d36-479d-4dc6-ac21-08d58db36bd1 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 16:05:44.3260 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1093 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Talat Batheesh [ Upstream commit 89c557687a32c294e9d25670a96e9287c09f2d5f ] Inserting steering rules with illegal ring is an invalid operation, block it. Fixes: 820672812f82 ('net/mlx4_en: Manage flow steering rules with ethtool'= ) Signed-off-by: Talat Batheesh Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/= ethernet/mellanox/mlx4/en_ethtool.c index ddb5541882f5..d9bb185f7320 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c @@ -1513,6 +1513,11 @@ static int mlx4_en_flow_replace(struct net_device *d= ev, qpn =3D priv->drop_qp.qpn; else if (cmd->fs.ring_cookie & EN_ETHTOOL_QP_ATTACH) { qpn =3D cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1); + if (qpn < priv->rss_map.base_qpn || + qpn >=3D priv->rss_map.base_qpn + priv->rx_ring_num) { + en_warn(priv, "rxnfc: QP (0x%x) doesn't exist\n", qpn); + return -EINVAL; + } } else { if (cmd->fs.ring_cookie >=3D priv->rx_ring_num) { en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist\n", --=20 2.14.1