All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Laura Abbott <labbott@redhat.com>
Cc: Sinan Kaya <okaya@codeaurora.org>,
	Dan Williams <dan.j.williams@intel.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-hardening@lists.openwall.com,
	Kees Cook <keescook@chromium.org>
Subject: dmaengine: dmatest: Remove use of VLAs
Date: Tue, 10 Apr 2018 21:08:55 +0530	[thread overview]
Message-ID: <20180410153854.GT6014@localhost> (raw)

On Mon, Apr 09, 2018 at 04:14:20PM -0700, Laura Abbott wrote:
> On 04/09/2018 03:48 PM, Sinan Kaya wrote:
> >On 4/9/2018 5:06 PM, Laura Abbott wrote:
> >>+			/* dst_cnt can't be more than u8 */
> >>+			dma_addr_t dma_pq[255];
> >
> >This is 2k stack space on 64 bit architectures. Isn't that a lot?
> >
> 
> Depends on your definition of 'a lot'. My assumption was that
> since this was a test module there would be some willingness
> to be a bit more generous. The problem is the array size is
> based off of the parameters passed in, although oddly enough
> it's based off of the minimum of two variables. If you have
> a suggestion for a tighter bound we can use that. Another
> option is to just switch to allocating the array with kmalloc.
> That might be reasonable here since there's other setup
> that happens before the test starts.

Being a test module I don't think I would have too many qualms with current
approach :) said that kmalloc approach seems reasonable too..

Thanks

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Laura Abbott <labbott@redhat.com>
Cc: Sinan Kaya <okaya@codeaurora.org>,
	Dan Williams <dan.j.williams@intel.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-hardening@lists.openwall.com,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] dmaengine: dmatest: Remove use of VLAs
Date: Tue, 10 Apr 2018 21:08:55 +0530	[thread overview]
Message-ID: <20180410153854.GT6014@localhost> (raw)
In-Reply-To: <9bdd8bb4-b6d9-e170-b585-b2dc3b8f0d67@redhat.com>

On Mon, Apr 09, 2018 at 04:14:20PM -0700, Laura Abbott wrote:
> On 04/09/2018 03:48 PM, Sinan Kaya wrote:
> >On 4/9/2018 5:06 PM, Laura Abbott wrote:
> >>+			/* dst_cnt can't be more than u8 */
> >>+			dma_addr_t dma_pq[255];
> >
> >This is 2k stack space on 64 bit architectures. Isn't that a lot?
> >
> 
> Depends on your definition of 'a lot'. My assumption was that
> since this was a test module there would be some willingness
> to be a bit more generous. The problem is the array size is
> based off of the parameters passed in, although oddly enough
> it's based off of the minimum of two variables. If you have
> a suggestion for a tighter bound we can use that. Another
> option is to just switch to allocating the array with kmalloc.
> That might be reasonable here since there's other setup
> that happens before the test starts.

Being a test module I don't think I would have too many qualms with current
approach :) said that kmalloc approach seems reasonable too..

Thanks
-- 
~Vinod

             reply	other threads:[~2018-04-10 15:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 15:38 Vinod Koul [this message]
2018-04-10 15:38 ` [PATCH] dmaengine: dmatest: Remove use of VLAs Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
2018-04-10  4:00 kbuild test robot
2018-04-10  4:00 ` [PATCH] " kbuild test robot
2018-04-10  4:00 ` kbuild test robot
2018-04-09 23:19 Sinan Kaya
2018-04-09 23:19 ` [PATCH] " okaya
2018-04-09 23:14 Laura Abbott
2018-04-09 23:14 ` [PATCH] " Laura Abbott
2018-04-09 22:48 Sinan Kaya
2018-04-09 22:48 ` [PATCH] " Sinan Kaya
2018-04-09 21:06 Laura Abbott
2018-04-09 21:06 ` [PATCH] " Laura Abbott

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=20180410153854.GT6014@localhost \
    --to=vinod.koul@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okaya@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.