All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tobin C. Harding" <me@tobin.cc>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Eric Anholt <eric@anholt.net>,
	Stefan Wahren <stefan.wahren@i2se.com>
Cc: kernel-hardening@lists.openwall.com,
	linux-kernel@vger.kernel.org,
	driverdev-devel@linuxdriverproject.org,
	Tycho Andersen <tycho@tycho.ws>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH v2] staging: vchiq_arm: Clear VLA warning
Date: Mon, 12 Mar 2018 16:46:13 +1100	[thread overview]
Message-ID: <20180312054613.GG8631@eros> (raw)
In-Reply-To: <1520818673-14084-1-git-send-email-me@tobin.cc>

On Mon, Mar 12, 2018 at 12:37:53PM +1100, Tobin C. Harding wrote:
> The kernel would like to have all stack VLA usage removed[1].  The array
> here is fixed (declared with a const variable) but it appears like a VLA
> to the compiler.  Also, currently we are putting 768 bytes on the
> stack.  This function is only called on the error path so performance is
> not critical, let's just allocate the memory instead of using the
> stack.  This saves stack space and removes the VLA build warning.
> 
> kmalloc a buffer for dumping state instead of using the stack.
> 
> [1]: https://lkml.org/lkml/2018/3/7/621
> 
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---

Drop this please, leaks memory.

thanks,
Tobin.

WARNING: multiple messages have this Message-ID (diff)
From: "Tobin C. Harding" <me@tobin.cc>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Eric Anholt <eric@anholt.net>,
	Stefan Wahren <stefan.wahren@i2se.com>
Cc: Tycho Andersen <tycho@tycho.ws>,
	driverdev-devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	kernel-hardening@lists.openwall.com
Subject: Re: [PATCH v2] staging: vchiq_arm: Clear VLA warning
Date: Mon, 12 Mar 2018 16:46:13 +1100	[thread overview]
Message-ID: <20180312054613.GG8631@eros> (raw)
In-Reply-To: <1520818673-14084-1-git-send-email-me@tobin.cc>

On Mon, Mar 12, 2018 at 12:37:53PM +1100, Tobin C. Harding wrote:
> The kernel would like to have all stack VLA usage removed[1].  The array
> here is fixed (declared with a const variable) but it appears like a VLA
> to the compiler.  Also, currently we are putting 768 bytes on the
> stack.  This function is only called on the error path so performance is
> not critical, let's just allocate the memory instead of using the
> stack.  This saves stack space and removes the VLA build warning.
> 
> kmalloc a buffer for dumping state instead of using the stack.
> 
> [1]: https://lkml.org/lkml/2018/3/7/621
> 
> Signed-off-by: Tobin C. Harding <me@tobin.cc>
> ---

Drop this please, leaks memory.

thanks,
Tobin.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2018-03-12  5:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12  1:37 [PATCH v2] staging: vchiq_arm: Clear VLA warning Tobin C. Harding
2018-03-12  1:37 ` Tobin C. Harding
2018-03-12  5:46 ` Tobin C. Harding [this message]
2018-03-12  5:46   ` Tobin C. Harding
2018-03-12  5:58   ` Stefan Wahren
2018-03-12  5:58     ` Stefan Wahren
2018-03-12  6:05     ` Tobin C. Harding
2018-03-12  6:05       ` Tobin C. Harding
2018-03-12 11:14     ` Dan Carpenter
2018-03-12 11:14       ` Dan Carpenter

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=20180312054613.GG8631@eros \
    --to=me@tobin.cc \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=eric@anholt.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefan.wahren@i2se.com \
    --cc=tycho@tycho.ws \
    /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.