Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753869AbcD1Urp (ORCPT ); Thu, 28 Apr 2016 16:47:45 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:42092 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297AbcD1Urn (ORCPT ); Thu, 28 Apr 2016 16:47:43 -0400 Date: Thu, 28 Apr 2016 16:47:40 -0400 (EDT) Message-Id: <20160428.164740.1969113968588250026.davem@davemloft.net> To: arnd@arndb.de Cc: saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com, achiad@mellanox.com, ogerlitz@mellanox.com, amir@vadai.me, tariqt@mellanox.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net/mlx5e: avoid stack overflow in mlx5e_open_channels From: David Miller In-Reply-To: <1461685993-1049370-1-git-send-email-arnd@arndb.de> References: <1461685993-1049370-1-git-send-email-arnd@arndb.de> X-Mailer: Mew version 6.6 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 28 Apr 2016 13:47:42 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 882 Lines: 21 From: Arnd Bergmann Date: Tue, 26 Apr 2016 17:52:33 +0200 > struct mlx5e_channel_param is a large structure that is allocated > on the stack of mlx5e_open_channels, and with a recent change > it has grown beyond the warning size for the maximum stack > that a single function should use: > > mellanox/mlx5/core/en_main.c: In function 'mlx5e_open_channels': > mellanox/mlx5/core/en_main.c:1325:1: error: the frame size of 1072 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] > > The function is already using dynamic allocation and is not in > a fast path, so the easiest workaround is to use another kzalloc > for allocating the channel parameters. > > Signed-off-by: Arnd Bergmann > Fixes: d3c9bc2743dc ("net/mlx5e: Added ICO SQs") > --- > v2: move allocation back into caller, as suggested by Saeed Mahameed Applied, thanks Arnd.