From: Chen Gang <gang.chen@asianux.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Chen Gang <gang.chen@asianux.com>,
Mike Frysinger <vapier@gentoo.org>,
Anton Vorontsov <anton.vorontsov@linaro.org>,
Richard Kuo <rkuo@codeaurora.org>,
Jesper Nilsson <jesper.nilsson@axis.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Miller <davem@davemloft.net>,
"uclinux-dist-devel@blackfin.uclinux.org"
<uclinux-dist-devel@blackfin.uclinux.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linux-Arch <linux-arch@vger.kernel.org>
Subject: Re: [PATCH] arch: blackfin: kernel: memory overflow, 'namebuf' length need be more than 256
Date: Wed, 29 May 2013 20:06:31 +0800 [thread overview]
Message-ID: <51A5EF47.4080101@asianux.com> (raw)
In-Reply-To: <CAMuHMdV17ZuCAdZq4vc+Av=r4b02OvjiEeRPxkq=7VrO3C7MSA@mail.gmail.com>
On 05/29/2013 07:30 PM, Geert Uytterhoeven wrote:
>> void show_regs(struct pt_regs *fp)
>> > {
>> > - char buf[150];
>> > + char buf[512];
> This will increase stack usage a lot. And this function calls decode_address(),
> which allocates another buffer on the stack.
>
Can it have a risk to cause the related stack used up ? (excuse me, I
don't know the system or thread stack size of blackfin).
If so, we really need save some byes (e.g. buf[300] ...), at least. But
I'm not sure whether it still has the risk too.
> However, as this is in debug code which is (never?) called concurrently, both
> buffers can be made static?
>
trap_c() may call show_regs(), and can multiple traps occur at the same
time ?
It seems it can (but I am not quite sure): for trap_c() only use stack
variables, and "cpu = raw_smp_processor_id()".
Thanks.
--
Chen Gang
Asianux Corporation
next prev parent reply other threads:[~2013-05-29 12:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 9:43 [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s' Chen Gang
2013-05-29 9:43 ` Chen Gang
2013-05-29 10:07 ` [PATCH] arch: blackfin: kernel: memory overflow, 'namebuf' length need be more than 256 Chen Gang
2013-05-29 11:30 ` Geert Uytterhoeven
2013-05-29 12:06 ` Chen Gang [this message]
2013-06-16 3:02 ` [PATCH] arch: blackfin: kernel: sprintf(), need avoid NUL for '%s' Mike Frysinger
2013-06-16 3:02 ` Mike Frysinger
2013-06-17 1:13 ` Chen Gang
2013-06-17 1:13 ` Chen Gang
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=51A5EF47.4080101@asianux.com \
--to=gang.chen@asianux.com \
--cc=akpm@linux-foundation.org \
--cc=anton.vorontsov@linaro.org \
--cc=davem@davemloft.net \
--cc=geert@linux-m68k.org \
--cc=jesper.nilsson@axis.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkuo@codeaurora.org \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
--cc=vapier@gentoo.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