From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70078.outbound.protection.outlook.com [40.107.7.78]) by dpdk.org (Postfix) with ESMTP id 5E80044C3 for ; Wed, 1 Aug 2018 12:44:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5fwWQm/KZUX/frYRRhxbLs9WUrEXf9eWacLJ3iz4UvE=; b=VVVWxoXVItA5Imrs1GlnVrbjm22NjyMwFyls6K8C5UO6ShLT8Nei0jrQ9NjE598athbbRlFxglncGm82ou8+Q9v36rxTieS3qYKjC8Fp9uXG7udYaMibrSI9L48LUqZ9dwsM0/6QP/InpeenY/uB7vUimn1CXBNxULXZNAakOyU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; Received: from localhost.localdomain (37.142.13.130) by DB7PR05MB4441.eurprd05.prod.outlook.com (2603:10a6:5:1b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.21; Wed, 1 Aug 2018 10:44:04 +0000 From: Moti Haimovsky To: shahafs@mellanox.com Cc: dev@dpdk.org, Moti Haimovsky , nelio.laranjeiro@6wind.com Date: Wed, 1 Aug 2018 13:43:38 +0300 Message-Id: <1533120218-32538-1-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: AM5PR0102CA0033.eurprd01.prod.exchangelabs.com (2603:10a6:206::46) To DB7PR05MB4441.eurprd05.prod.outlook.com (2603:10a6:5:1b::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b56bec4a-e7ec-49c9-2347-08d5f79bb3ce X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4441; X-Microsoft-Exchange-Diagnostics: 1; DB7PR05MB4441; 3:7HZlkb84nl2ed+k+o1U4Wwbv6K9WoZ9sF6Vypc1SfcRkZAmddjAXPngG2hSawryaUBSd6wONcT798C6XGNfIkNbLCq6/yQTVm20BRLySoO0Dy4+TZVDkVg/6Vvtu/QhyBHLUJnz6ZWby0C00kqELdYQt/ylmMDaUmZK7yu5cv93hoY3nAYQhq6fDX4qT0Y4EgNVPr0UVT2by4w7Dj7UXUVeqODlIi3rf1VENlW1X+nwn23dpILwGAIHP6CC4bHNG; 25:iMvnaHWo3NKK9bdx551jVaVE+F0DkF2Wkj6oPbIc6BdRg/o4dhQ6VtdjD181t2LHzFlKFtMCwTXzl66Z6/LZ7a0TWnhEKfcuoEAoO8erJOMs+d8AUS25zTZmPCjJGxuanepAYbqm9IMjFvoL32QLmYRn9wDRYHYwn/LDQrjOLhkcwP3sRDLo5y/CYvpJWykcBGewCtkDtiB/eh9npqeFWqiNY0ivZtbkmWlFi+h4MYRnzM1axbdIsTUHzAwa77W1aO13i2LwS3Gd7hddqkmaYNork80RMNTinSgM48C3WokttS50h3VPAbT7KHcjFR0QJ23y5U2bBxOqSyukzVkmQQ==; 31:3aMUJldzSbfNeNUSyOB6uXewECfBAsrCUJ6nyWMxlJd8kDp7ayp/dfD9ClfGUQ6zvoFc6JzL9yMNv1EkPlGXibDMQMBmEK94W+UyoVj/nhhor49LUyhhvKWDKPOwO1oObVf/2A0YQ37ij/xwzq0ZQnHlWLA+R6xlZHPCBVSv0Yfe3KVK6SwJxnCbnW9G5YdSPLyyR0IZZtjsUqGSZH24wDpMKGyHBUb1Pl2am0CZ6Ds= X-MS-TrafficTypeDiagnostic: DB7PR05MB4441: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB7PR05MB4441; 20:xRujYUxFk+CLCEE43t0LFAbPk5yn7tY7/ud7XFFG7IeCmJx8R0UmI7bNK7zY2rfNNTUKwL2UXECN+QsVfHjRPhyYAPOH0z252tQD+Y2palWhwvWX+ixc1udKrK8HUV+5I35CEKkay61tZSqmgO71UXaK/yPzkv5gFDPqrRCFw8xIbrR+WUa5Q6U3h2ot4JEpZabhRg99do2QJonIovxQJAXMMJMDRZpWJJYK5T22ZFq/4VHuaDDBbDahLTlbWLJjIa7xe0nAbKrMQSj+HN2fHTu4loNecSR2E+0URY7ogRfpGRlxhYmOTU6OpMmdU/tighmFktlLPZD6tIOf8eHkldwiFJJLeRaqRiZEPQGjzNBpC0kqYuLfTZxbl8tJ72ECtgahRofURS+ie4kd3FFuf5HDdlsKAY7OxG2SgkswPhmVuQvmd43vj19l45wQGv+TQuQqXXuU1bhCaFgWauBC1626kjgi/dBjENCBb8j2LPxlzO4XnCk9YXqh9ePptHcZ; 4:Cl2husR1eNft6FyJdU0GE8ASs194EAZ8e38xJqyErl+5qwuyqysRPj00CGcCCLhJ9Rxi+wFjFQCffTXYxXr3i69f8sqRdQUO12Z8ACO5cCZSyL0r0m2rTHaD1P1jHiuPoKQ9Y6HUYI3ZD1s7X4yvZzmA+APOdkEykypgdE4oy488+3Za8PrKQ2w3XRsSRBxrrzB9V1yzcnYvAuTvWrnRPt/eXIRakR+9S2s5WurctRYNTzWgBG/BjQHoXKOVrs/Wd8QHvYqqkBrk3xVYzDMzPg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4441; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4441; X-Forefront-PRVS: 0751474A44 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(366004)(396003)(136003)(39860400002)(346002)(189003)(199004)(26005)(3846002)(7736002)(305945005)(25786009)(6116002)(5660300001)(2906002)(4326008)(6666003)(6636002)(478600001)(81156014)(8936002)(81166006)(68736007)(8676002)(50466002)(86362001)(16526019)(50226002)(36756003)(1857600001)(37006003)(2351001)(6506007)(47776003)(97736004)(51416003)(956004)(386003)(16586007)(6512007)(476003)(486006)(2616005)(2361001)(66066001)(48376002)(34206002)(106356001)(53936002)(52116002)(105586002)(6486002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4441; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB7PR05MB4441; 23:qXHdII/qbajXrvH1eszhIfqYzSeWXJhyID34UsnYL?= =?us-ascii?Q?BJGhHF59pmLPK5NWXoPkEsodjE3bHSbeb8OiwOyf+xs0wVenRgmLNqJrl8Gp?= =?us-ascii?Q?YXVxZqD+tI2TfaYoxD/xajVc+5YHdar8FbmXbKcmm7PfjTW2al2IOwWgQvAm?= =?us-ascii?Q?HQNr9S5Qk4PmQKD0fL+RPVvp5aKb16SichXysD/J8MqxiDHzZ6oSsKLqH+b0?= =?us-ascii?Q?Lw1flXyf4LnHMGdGYTvwnaZUkIAJ8hDL4Z/mia+LjL+Hdx0BJ0uQ6N8rXqmJ?= =?us-ascii?Q?r1YjWiKX8utsm+Fg2g0PrxLJFB1h6xjkts17UcG7powzMm9KXMYCEPKVo8oc?= =?us-ascii?Q?6lyAM54KAvGHhmomw4rqvnjn5JxUSY4UTxCyO5t8BQj6iq5JYq407vcDRRie?= =?us-ascii?Q?lVgt2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BdGSg1wu5IGHpfQaXS50YckTJIj0Zfx9n6E2f9ecivQYDadaOT7guyf7/vWBKQXeo5U/wh2tPiz29Bk1jsXHyfEKDlyf/HXUVxA3wGaLFvwmnB1SwV3/y2AvsEszxf3yL+EHM1Kj2DgDvjgDRbg7XflJyi4YJqlWEKB5WpXqy0NljOGL2c6DCN6UPorw2CT4Z5sG7OFVZZ/NZVcodv+m4TWT1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 10:44:04.4470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b56bec4a-e7ec-49c9-2347-08d5f79bb3ce X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4441 Subject: [dpdk-dev] [PATCH] net/mlx5: fix RSS flow configuration crash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2018 10:44:06 -0000 This commit fixes a segmentation fault observed when configuring mlx5 with RSS flow rule containing invalid queues indices such as negative numbers or numbers bigger than the number Rx queues the PMD is configured with. Fixes: 592f05b29a25 ("net/mlx5: add RSS flow action") Cc: nelio.laranjeiro@6wind.com Signed-off-by: Moti Haimovsky --- drivers/net/mlx5/mlx5_flow.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 6c3021a..0b55366 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2077,6 +2077,12 @@ struct mlx5_flow_tunnel_info { "some RSS protocols are not" " supported"); for (i = 0; i != rss->queue_num; ++i) { + if (rss->queue[i] >= priv->rxqs_n) + return rte_flow_error_set + (error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, + &rss->queue[i], + "queue index out of range"); if (!(*priv->rxqs)[rss->queue[i]]) return rte_flow_error_set (error, EINVAL, -- 1.8.3.1