From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 8EC724C7B for ; Fri, 23 Feb 2018 17:52:54 +0100 (CET) Received: by mail-wr0-f194.google.com with SMTP id u49so14750406wrc.10 for ; Fri, 23 Feb 2018 08:52:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=O55MPWeoI+ZWrMvJRXzcFQWy/MCP16CcgYx9VAZkJL8=; b=cc1r3gpSMMx7qnScTn4iPFfgrxRR1MfoyE9XjEq+puI0IaiVwnyUNZXWXf88uHcGZY Wkn0o0TXKqGk9bgG84OGgNz/85EB4yJC7v0ITNClXpE06+2gd7aNemA7Klhp08f+GGMd ih+p3bSyHQbrXBsFlKDaY98+B3CoX5BWiHnSMiDQ4QgRbsX4/5153lB/D3oETBWIcg8k yrgnYxTbHB94EYLS4GRYjDb9URu/MQiEvpK7QBqbnJXUq9oLvtXxzQ9NT94hNP3QCVwM hwvYv2mNxjYk7h0L3Je5BJA1XqiTQyk1D5jO0gwCoR1Mc4UGKTMTRUy9scVzbz0zfbSl kfdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=O55MPWeoI+ZWrMvJRXzcFQWy/MCP16CcgYx9VAZkJL8=; b=cP4U2Jt37rWRjXXKDOsF4h6HzcW/ksGYGesdMVZw6Oz9I/GQjv80KN9cgD/o6gL87d PFjRo6YGXIlPb9LJgVaBV5LrLmTWqvZDbVVFory95IUEoeFW1YbHn0jFGBlkE0O6TWPz 0FBUMbPXufCgf1XWTF0nR619BPvv8UkMUZIEn7cS3ukpG8Ufd9s9Tss5zhoSQAOAbMBF OLvj8APpm+p1qTpKbTLDCO0mMY7j+NG7aF7edwIblCM/ZIuQ8rys7zBlM6egePmzFkLh ycQaHTbLC3odvin96oP88MbAibEU67B/fCZUzwukYHpE1kZ5yNArF3yTlut6Ra+7ojvr KZqg== X-Gm-Message-State: APf1xPD8F3899fPuCbbSLZcPFPIIaFS5KViIZDKksmRxQ+Px0rD+MWFT Je568so9oaZGHOrwwgr/Esur1A== X-Google-Smtp-Source: AH8x225VNdoBf6lSC/LRMhFodIRuLOOpR/NfnLfIavOHI+Rc8UHcYrLXSenPart0j3Cvdx8XyaUTFg== X-Received: by 10.223.142.5 with SMTP id n5mr2421626wrb.28.1519404774205; Fri, 23 Feb 2018 08:52:54 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id z18sm3449367wrh.2.2018.02.23.08.52.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 08:52:53 -0800 (PST) Date: Fri, 23 Feb 2018 17:52:39 +0100 From: Adrien Mazarguil To: Ophir Munk Cc: dev@dpdk.org, Thomas Monjalon , Olga Shern , stable@dpdk.org Message-ID: <20180223165239.GL4256@6wind.com> References: <1519220318-19328-1-git-send-email-ophirmu@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519220318-19328-1-git-send-email-ophirmu@mellanox.com> Subject: Re: [dpdk-stable] [PATCH v1] net/mlx4: fix RSS actions with no parameters X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2018 16:52:54 -0000 On Wed, Feb 21, 2018 at 01:38:38PM +0000, Ophir Munk wrote: > When creating an RSS flow with missing actions parameters, for example: > flow create 0 ingress pattern / end actions rss / end > > testpmd aborts with segmentation fault. > In the corrupted code mlx4_flow_prepare() accesses RSS action->conf pointer > without verifying its validity. > In case of missing RSS actions parameters this pointer is NULL and must not > be accessed. Problem is that testpmd is far from perfect and shouldn't feed PMDs with invalid pointers in the first place. The configuration structure is not documented as optional with actions that take one. > The fix is to return an error in such cases "missing rss actions". > > Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support") > Cc: stable@dpdk.org > > Signed-off-by: Ophir Munk I suggest to fix this at once for all present and future PMDs in testpmd directly. It may be added as a workaround in mlx4 but not as a fix since the cause is not in that PMD. > --- > drivers/net/mlx4/mlx4_flow.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c > index 2d55bfe..7a127a8 100644 > --- a/drivers/net/mlx4/mlx4_flow.c > +++ b/drivers/net/mlx4/mlx4_flow.c > @@ -735,6 +735,10 @@ mlx4_flow_prepare(struct priv *priv, > if (flow->rss) > break; > rss = action->conf; > + if (!rss) { > + msg = "missing rss actions"; > + goto exit_action_not_supported; > + } This message may be understood as a lack of RSS action, while it is in fact present. This error can be more accurately described as: "RSS action configuration wasn't provided" Note the same issue exists with the QUEUE action handled just prior to this one and probably affects other PMDs as well. You really should consider fixing testpmd instead. -- Adrien Mazarguil 6WIND