linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	Stephen Kitt <steve@sk2.org>,
	"David S. Miller" <davem@davemloft.net>
Cc: Atul Gupta <atul.gupta@chelsio.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] crypto: chelsio - remove extra allocation for chtls_dev
Date: Fri, 14 Feb 2020 13:40:02 +0530	[thread overview]
Message-ID: <23d0939e-0a7b-f822-ae64-0cb64f6aefc2@chelsio.com> (raw)
In-Reply-To: <20200213054751.4okuxe3hr2i4dxzs@gondor.apana.org.au>

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 <steve@sk2.org>
> 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,

  reply	other threads:[~2020-02-14  8:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 22:20 [PATCH] crypto: chelsio - remove extra allocation for chtls_dev Stephen Kitt
2020-02-13  5:47 ` Herbert Xu
2020-02-14  8:10   ` Vinay Kumar Yadav [this message]
2020-02-22  1:40 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23d0939e-0a7b-f822-ae64-0cb64f6aefc2@chelsio.com \
    --to=vinay.yadav@chelsio.com \
    --cc=atul.gupta@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=steve@sk2.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).