mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: engler@csl.Stanford.EDU
Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org,
	macro@ds2.pg.gda.pl, mingo@redhat.com
Subject: Re: [CHECKER] large stack variables (>=1K) in 2.4.4 and 2.4.4-ac8
Date: Fri, 25 May 2001 01:01:48 +0200 (MET DST)	[thread overview]
Message-ID: <200105242301.BAA05771@harpo.it.uu.se> (raw)

On Thu, 24 May 2001 14:10:00 -0700 (PDT), Dawson Engler wrote:

>[BUG]
>/u2/engler/mc/oses/linux/2.4.4-ac8/arch/i386/kernel/nmi.c:47:check_nmi_watchdog: ERROR:VAR:47:47: suspicious var 'tmp' = 1024 bytes:47 [nbytes=1024]
>#define P6_EVENT_CPU_CLOCKS_NOT_HALTED	0x79
>#define P6_NMI_EVENT		P6_EVENT_CPU_CLOCKS_NOT_HALTED
>
>int __init check_nmi_watchdog (void)
>{
>
>Error --->
>	irq_cpustat_t tmp[NR_CPUS];

Nice work, but I think this is a false positive.

check_nmi_watchdog() is __init and we know exactly when it's called.
The interesting cases (SMP kernel, since for UP NR_CPUS==1) are:

start_kernel -> smp_init -> smp_boot_cpus -> APIC_init_uniprocessor
-> check_nmi_watchdog

and

start_kernel -> smp_init -> smp_boot_cpus -> setup_IO_APIC ->
check_timer -> check_nmi_watchdog

In neither case is the stack large enough that the 1KB blob in
check_nmi_watchdog should pose a problem, I think. (Don't we have
something like 8KB-sizeof(struct task_struct) stack to play with?)

IMHO the checker tool should take call paths into consideration
when trying to detect stack overflow problems. Does it do that?
(I.e. is it polyvariant or monovariant?)

I could write a patch to make 'tmp' __initdata instead, which would
silence the checker tool, but I don't really want to do that unless
someone can convince me that there is a real problem here.

/Mikael

             reply	other threads:[~2001-05-24 23:02 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-24 23:01 Mikael Pettersson [this message]
2001-05-25  2:48 ` Dawson Engler
2001-05-25  3:00   ` Alexander Viro
2001-05-25  3:07     ` Dawson Engler
  -- strict thread matches above, loose matches on Subject: below --
2001-07-03  9:15 VDA
2001-05-25  4:23 Dunlap, Randy
2001-05-24 21:10 Dawson Engler
2001-05-24 22:40 ` Anton Altaparmakov
2001-05-24 23:08 ` Andreas Dilger
2001-05-24 23:33   ` Andi Kleen
2001-05-25  5:20     ` Keith Owens
2001-05-25  6:33       ` Andreas Dilger
2001-05-25  6:53         ` Keith Owens
2001-05-25  8:20           ` Andi Kleen
2001-05-25  8:31             ` Keith Owens
2001-05-25  8:39               ` Andi Kleen
2001-05-25 14:03           ` Oliver Neukum
2001-05-25 14:07             ` Andi Kleen
2001-05-25 15:45               ` dean gaudet
2001-05-25 16:34                 ` Jonathan Lundell
2001-05-25 18:37                   ` dean gaudet
2001-05-25 17:49                     ` Jeff Dike
2001-05-25  7:11       ` David Welch
2001-05-25  8:08         ` Keith Owens
2001-05-25 15:31         ` dean gaudet
2001-05-25 15:49           ` Keith Owens
2001-05-25 18:46             ` dean gaudet
2001-05-25  8:14       ` Andi Kleen
2001-05-25  8:25         ` Keith Owens
2001-05-25  8:27           ` Andi Kleen
2001-05-25  8:37             ` Keith Owens
2001-05-25  8:17       ` Andi Kleen
2001-05-25 11:52     ` Brian Gerst
2001-05-25 11:53       ` Andi Kleen
2001-05-25 12:07         ` Brian Gerst
2001-05-25  3:38   ` Andrew Morton

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=200105242301.BAA05771@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=engler@csl.Stanford.EDU \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@ds2.pg.gda.pl \
    --cc=mingo@redhat.com \
    /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

all inboxes | Powered by JetHome®