Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp173203ybv; Wed, 12 Feb 2020 21:48:30 -0800 (PST) X-Google-Smtp-Source: APXvYqzzglYLFnG2EHofJ0Kyw9tifYfkOnbgSA8LiYzbABRSmLdeLWw+3HLq8nzegTWz+fLrtAn1 X-Received: by 2002:aca:5258:: with SMTP id g85mr1898727oib.80.1581572910118; Wed, 12 Feb 2020 21:48:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581572910; cv=none; d=google.com; s=arc-20160816; b=p2OwMu0Khyx06GzWhCIcCOBVSK+hr77OpNrm89CV4lNgG0Of43Ir+8mV1AlDuklSiT 20m2k+8gyznsPadsBHOejiOS6cou8a0fNcoU0s0DNXnUtHzG6b0vdwNMzfKTu1YXera4 jdU4BIzzGY70+50Gw45ed/5ZUBgt25jAmachepNpsixfHBv/sHWfgARgaTp21/XWhff1 YqHv3TTNk6oQ6ru8NcwVxl25BLIQjaDXZruuTnfWA2/rPeeBIswUVaIR3hIAYnxJ7/ej flM9SBx2dCS7ErD2Bj2PA824BsL8kdQjGJxYg72G2ZCjpPa4CUBve2y0X5Hnl63plexs UO5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+QmI2W/GsaHB2ZQrKb5tkJseMtpe8kLvt+uLPv6KJ2Y=; b=dE1llcqQRmNXXQNUcsMFURjPqsQ4Atkb4QNGtNdfxuB/QnOlP9Ee6uAc/SOIz+BGeU zIctRpTL7KEqotXMiCx0+4lipnm4h9Hl+T3AhagOYkJV67XxZrT288IoFHrBe5LpR3YQ zFvAC60d3u4kaqkFufG+BMLlQ0lQfGiPx+ZwKK594A4tDtdxQ5axeqa6cZ+XXFb3CG4H 5wv526EEmGvC/FCHXh3iOja06KvaI5Dxp1sDdDsfTNU8n4Ag4TjMN0OKRJ9OJe5TiEk8 LLdtQ43oNzKle1VSPqvT35WCcyPbXnSlDcZBG1633k0vUfCV9HlzHafhUH0eJ6srUJGK pdWg== 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 k10si615847otn.323.2020.02.12.21.48.18; Wed, 12 Feb 2020 21:48:30 -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 S1729678AbgBMFsI (ORCPT + 99 others); Thu, 13 Feb 2020 00:48:08 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:36936 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725773AbgBMFsI (ORCPT ); Thu, 13 Feb 2020 00:48:08 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1j27Lv-0002va-Ue; Thu, 13 Feb 2020 13:47:56 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1j27Lr-0001EJ-Vy; Thu, 13 Feb 2020 13:47:52 +0800 Date: Thu, 13 Feb 2020 13:47:51 +0800 From: Herbert Xu To: Stephen Kitt , "David S. Miller" Cc: Atul Gupta , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Vinay Kumar Yadav , netdev@vger.kernel.org Subject: Re: [PATCH] crypto: chelsio - remove extra allocation for chtls_dev Message-ID: <20200213054751.4okuxe3hr2i4dxzs@gondor.apana.org.au> References: <20200124222051.1925415-1-steve@sk2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200124222051.1925415-1-steve@sk2.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt