netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: netdev@vger.kernel.org
Cc: Joern Engel <joern@lazybastard.org>,
	David Miller <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>
Subject: speaking of stacks
Date: Mon, 31 Mar 2008 09:15:56 -0400	[thread overview]
Message-ID: <1206969356.4424.120.camel@localhost> (raw)


All this talk about stacks got me thirsty.
Heres something thats a mystery to me; probably very basic
when doing static check analysis (kernel make checkstack)

I have ipsec turned on in the linus git tree kernel and
net/xfrm/xfrm_user.c::xfrm_get_policy() shows up as one of
the top offenders. Eyeballing reveals that
struct xfrm_policy seems to be the offender 
in the else {} after if (p->index) in that function.
That seems understandable - once variable "tmp" is declared it goes
on the stack and it is freakin huge. 
However, checkstack only seems to catch it if i have the
line "memset(&tmp, 0, sizeof(struct xfrm_policy))". If i remove
that line - even though tmp is on the stack - checkstack doesnt catch
it.

What gives?

----
hadi@lilsol:~$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c
++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
-----

Not a gcc guru by far.
Anyone interested, I can send you the .o before and after commenting
for your perusal.

cheers,
jamal


             reply	other threads:[~2008-03-31 13:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31 13:15 jamal [this message]
2008-04-03 21:18 ` speaking of stacks David Miller
2008-04-04 12:24   ` jamal
2008-04-04 12:32     ` Paul Moore
2008-04-04 12:41       ` jamal
2008-04-04 22:31         ` Paul Moore

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=1206969356.4424.120.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=joern@lazybastard.org \
    --cc=netdev@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).