Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1474537ybv; Fri, 14 Feb 2020 00:10:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzGjhOp13ZjBsMYgSeYstGFpF8tXE3w+yInrk4HHH6VOVP8++dzjS4gEjsOOF0M/PSRjMJF X-Received: by 2002:a9d:7e99:: with SMTP id m25mr1282302otp.212.1581667840850; Fri, 14 Feb 2020 00:10:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581667840; cv=none; d=google.com; s=arc-20160816; b=ggSNjd3nzpCXxBH1tit4GYHPuJfcgHlXV94fZ6vxcoImSynmRkgVUv/uWKI2h5V1Sm VOe8mZL7g0a3Bi3kGZzyfFa9Vv267mIYzywIk8IKYtAkBkIz5H8bijNXcHtd8zXCmsNQ gARbRvFsly3ENdueSpj/eq/rI9rX3u8ugltMrhMWhJRioLbK6Ctj9kEUkDmR9V4g0d27 tGJCkvMIBbR+ZO4tMGjgyHBRpfKOBQKflAz9S1PZPlQxcDiI9zANWVWnRNY1FW//ntAs O9eNkx5UIzyI36PdLq5ZPpIUgamKX+OLTgl4bBfK308uGLsZvkZoyPTQGCTP0Q4V7FPm QXXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=pbHGNmvaOR/Ye8460Qh6ItsiW8KFWyFRS8qiz8qV+n0=; b=sa5LTNxHwERHCMIeMb5qTN583v7mjWMW5DcY7AkKE/aE4RfO/SWdlxOFtfnJzZwC50 HnUWxXIJNcfuz/lu32U5L+5HMwCdUuxMlgDeLvjI2TrjKH+rL9/Mtm3cpANHwp7k6VuW eqxICUSGL0NBQUwskdeKmTm57D59b5RCfyrbyoiBX5OzkaHLtlKemewxmFwm+3clfjJP IAsN6nJ8gZ7aACzBfpp7rPCwaD517uhfu0z1LzBKBDE+/9kJwIxxOrKQ9qP0g6qdp600 YTM1oUiua8ef06CSqrR0pbg5bJnJtQzqSUDZtXUdVOD/eH7C5LYdq88AlKXJA5bFOR8U LdFA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si2460752oto.85.2020.02.14.00.10.27; Fri, 14 Feb 2020 00:10:40 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728841AbgBNIKW (ORCPT + 99 others); Fri, 14 Feb 2020 03:10:22 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:7483 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726004AbgBNIKW (ORCPT ); Fri, 14 Feb 2020 03:10:22 -0500 Received: from [10.193.191.83] (vinay-kumar.asicdesigners.com [10.193.191.83]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id 01E8A37G002040; Fri, 14 Feb 2020 00:10:04 -0800 Subject: Re: [PATCH] crypto: chelsio - remove extra allocation for chtls_dev To: Herbert Xu , Stephen Kitt , "David S. Miller" Cc: Atul Gupta , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org References: <20200124222051.1925415-1-steve@sk2.org> <20200213054751.4okuxe3hr2i4dxzs@gondor.apana.org.au> From: Vinay Kumar Yadav Message-ID: <23d0939e-0a7b-f822-ae64-0cb64f6aefc2@chelsio.com> Date: Fri, 14 Feb 2020 13:40:02 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200213054751.4okuxe3hr2i4dxzs@gondor.apana.org.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Herbert, On 2/13/2020 11:17 AM, Herbert Xu wrote: > On Fri, Jan 24, 2020 at 11:20:51PM +0100, Stephen Kitt wrote: >> chtls_uld_add allocates room for info->nports net_device structs >> following the chtls_dev struct, presumably because it was originally >> intended that the ports array would be stored there. This is suggested >> by the assignment which was present in initial versions and removed by >> c4e848586cf1 ("crypto: chelsio - remove redundant assignment to >> cdev->ports"): >> >> cdev->ports = (struct net_device **)(cdev + 1); >> >> This assignment was never used, being overwritten by lldi->ports >> immediately afterwards, and I couldn't find any uses of the memory >> allocated past the end of the struct. >> >> Signed-off-by: Stephen Kitt > Thanks for the patch! > > I think the problem goes deeper though. It appears that instead > of allocating a ports array this function actually hangs onto the > array from the function argument "info". This seems to be broken > and possibly the extra memory allocated was meant to accomodate > the ports array. Indeed, the code removed by the commit that you > mentioned indicates this as well (although the memory was never > actually used). Yes, memory was never used. Author allocated port array but later realized that he can use port array allocated by lld(cxgb4) and missed to remove memory allocation at commit mentioned in patch. I think this patch will correct memory allocation. > > Dave, I think we should talk about the maintainence of the chelsio > net/crypto drivers. They have quite a bit of overlap and there is > simply not enough people on the crypto side to review these drivers > properly. Would it be possible for all future changes to these > drivers to go through the net tree? > > Cheers,