From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [digsig:working 47/64] security/integrity/digsig.c:74:1: warning: 'shash_digest' uses dynamic st
Date: Thu, 13 Sep 2012 15:10:15 +0000 [thread overview]
Message-ID: <20120913151015.GO19396@mwanda> (raw)
In-Reply-To: <20120913144807.GA2562@localhost>
On Thu, Sep 13, 2012 at 10:48:07PM +0800, Fengguang Wu wrote:
> Hi Dmitry,
>
> I'm not sure if the warned 'dynamic stack allocation' is relevant, but
> as an FYI:
>
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/kasatkin/linux-digsig.git working
> head: ca88a6aa648a167b6f8e5666518249635510b0b0
> commit: c6a28f9ee92fe96c5a7c4e5989eb7ae06b545469 [47/64] integrity: added digest calculation function
> config: s390-allyesconfig
>
> All error/warnings:
>
> security/integrity/digsig.c: In function 'shash_digest':
> security/integrity/digsig.c:74:1: warning: 'shash_digest' uses dynamic stack allocation [enabled by default]
>
> vim +74 security/integrity/digsig.c
> 64 char ctx[crypto_shash_descsize(tfm)];
^^^^^^^^^^^^^^^^^^^^^^^^^^
Where it wouldn't be relavent is if the size of the can be made to
overflow the 8k kernel's stack. We've seen places where this could
be controlled by the user before.
Also it's not ok inside a for loop. On some arches the dynamic
allocations aren't freed at the end of the loop, only at the end
of the function. So inside a for loop the stack keeps getting
bigger and bigger until it overflows the 8k stack. (Doesn't happen
on x86).
regards,
dan carpenter
prev parent reply other threads:[~2012-09-13 15:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 14:48 [digsig:working 47/64] security/integrity/digsig.c:74:1: warning: 'shash_digest' uses dynamic stack Fengguang Wu
2012-09-13 14:49 ` [digsig:working 47/64] security/integrity/digsig.c:74:1: warning: 'shash_digest' uses dynamic st Kasatkin, Dmitry
2012-09-13 15:10 ` Dan Carpenter [this message]
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=20120913151015.GO19396@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.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).