From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id E7FFE5A44 for ; Wed, 1 Aug 2018 13:01:22 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id c13-v6so19667901wrt.1 for ; Wed, 01 Aug 2018 04:01:22 -0700 (PDT) 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=Xo9VfZLg2hGQMzTsWDNGJ7qbsGlUY5INTMI33DWXMf8=; b=vC/pqMoqG8y7S4iWCKGgem+VHQczpp+jqenoFpv4sxCh/BJdUuLbkqR7/XBG/G2cqW XQIKzKsyBiAQzoxHxf5LGqH6NZyT54TA4FRFTgo1PdI8ZVhOwGPt1BwInonGxk1Bm/rc B9r2hYfxSi1+a6wSWFdmOdlwuxgFCE2t/s1IhRXIRkJhMV5ECskPemLiGVeADuLYmcIn /LOm2aF0zbxeNLoE6eMlO4O//IvFu5aIoAi8mRNjd7dzKSxdutd7HfEEj8k8RMmkA6BC wsMXLQwn54x24ZHB2OPB6DWsxGjOhnyIgdb3U+xNu7BJCZuV5slmWkwq9OreQkg+AFml v63A== 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=Xo9VfZLg2hGQMzTsWDNGJ7qbsGlUY5INTMI33DWXMf8=; b=aqbmBmLvE8UVgV1CAvRg7sBmaFXkC8LX6qCz4qcnE5haIJwVhoBct7oHQ/oDYSjE3L EMItc2xjsT+/iOjAc4g6zRaMn0V/12xJiP3pfW8WZsVzV1Bd1WQ4TqRwuUyrFGflUHbu 7B2D3Dnkgs0oY0Q8drd5NW8RYPrcN8dWmO09ZBMALZct+e8QAWLyE2N57+lWD+xZBgrD DdCAR4EkKW5FaMXYz1Sbz7BjxqxyVlDVyHa0cRoPyIRlHKYSDtIuVJ9VKQP4/z2fIaD+ YgkN3i0cVF6zmQN584O7WFNIN4tBYdTBGVB8/R4Ly89b6fjXRwsj5HbolXWxYI0bx9r+ jqww== X-Gm-Message-State: AOUpUlEXOwH41L+/uv1d6HT4B+53R+MvTiRmH8V+rTMLgWMMI/dRNCke sabM87XyfKlqDCGexp+iAxFZrWAiODmpyQ== X-Google-Smtp-Source: AAOMgpehkoPOicteEmI9LOIDcx1rl20RXsP6GLkbptNWigHjV+CGV5z8pINMSJYIJUyT2pjJgXaKqw== X-Received: by 2002:adf:dfcd:: with SMTP id q13-v6mr23418390wrn.113.1533121282676; Wed, 01 Aug 2018 04:01:22 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id s2-v6sm28982288wrn.83.2018.08.01.04.01.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 04:01:21 -0700 (PDT) Date: Wed, 1 Aug 2018 13:01:05 +0200 From: Adrien Mazarguil To: Moti Haimovsky Cc: shahafs@mellanox.com, dev@dpdk.org, nelio.laranjeiro@6wind.com Message-ID: <20180801110104.GE5211@6wind.com> References: <1533120218-32538-1-git-send-email-motih@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1533120218-32538-1-git-send-email-motih@mellanox.com> Subject: Re: [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 11:01:23 -0000 On Wed, Aug 01, 2018 at 01:43:38PM +0300, Moti Haimovsky wrote: > 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], When specified, the object associated with RTE_FLOW_TYPE_ACTION_CONF is the configuration structure itself, not the data of an inner field. This type is that of the the pointed object; the caller may attempt to dereference it accordingly. In short, use either "action->conf" or "rss" instead of "&rss->queue[i]" here. -- Adrien Mazarguil 6WIND