All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: David Laight <David.Laight@ACULAB.COM>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 2/7] sock_diag: Do not use RTA_PUT() macros
Date: Wed, 27 Jun 2012 06:07:43 -0400	[thread overview]
Message-ID: <20120627100743.GE31808@canuck.infradead.org> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B6F66@saturn3.aculab.com>

On Wed, Jun 27, 2012 at 11:00:30AM +0100, David Laight wrote:
>  
> > @@ -35,9 +34,7 @@ EXPORT_SYMBOL_GPL(sock_diag_save_cookie);
> >  
> >  int sock_diag_put_meminfo(struct sock *sk, struct sk_buff 
> > *skb, int attrtype)
> >  {
> > -	__u32 *mem;
> > -
> > -	mem = RTA_DATA(__RTA_PUT(skb, attrtype, SK_MEMINFO_VARS *
> sizeof(__u32)));
> > +	u32 mem[SK_MEMINFO_VARS];
> 
> Isn't that likely to blow the kernel stack?

SK_MEMINFO_VARS = 8, so no. I can change it to use nla_reserve()
if wasting 32 bytes on the stack is an issue.

  parent reply	other threads:[~2012-06-27 10:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27  9:36 [PATCH 0/7] Get rid of RTA*() macros Thomas Graf
2012-06-27  9:36 ` [PATCH 1/7] unix_diag: Do not use RTA_PUT() macros Thomas Graf
2012-06-27  9:36 ` [PATCH 2/7] sock_diag: " Thomas Graf
2012-06-27 10:00   ` David Laight
2012-06-27 10:07     ` David Miller
2012-06-27 10:07     ` Thomas Graf [this message]
2012-06-27  9:36 ` [PATCH 3/7] inet_diag: " Thomas Graf
2012-06-27  9:36 ` [PATCH 4/7] ipmr: " Thomas Graf
2012-06-27  9:36 ` [PATCH 5/7] ip6mr: " Thomas Graf
2012-06-27  9:36 ` [PATCH 6/7] decnet: " Thomas Graf
2012-06-27  9:36 ` [PATCH 7/7] netlink: Get rid of obsolete rtnetlink macros Thomas Graf
2012-06-27 15:35   ` Stephen Hemminger
2012-06-27 22:04     ` David Miller
2012-06-27 22:31       ` Stephen Hemminger
2012-06-27 22:37 ` [PATCH 0/7] Get rid of RTA*() macros David Miller

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=20120627100743.GE31808@canuck.infradead.org \
    --to=tgraf@suug.ch \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --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 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.