[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120627100743.GE31808@canuck.infradead.org>
Date: Wed, 27 Jun 2012 06:07:43 -0400
From: Thomas Graf <tgraf@...g.ch>
To: David Laight <David.Laight@...LAB.COM>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH 2/7] sock_diag: Do not use RTA_PUT() macros
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists