[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080912003522.GN20815@postel.suug.ch>
Date: Fri, 12 Sep 2008 02:35:23 +0200
From: Thomas Graf <tgraf@...g.ch>
To: David Miller <davem@...emloft.net>
Cc: vegard.nossum@...il.com, netdev@...r.kernel.org,
penberg@...helsinki.fi, mingo@...e.hu, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] netlink: fix overrun in attribute iteration
* David Miller <davem@...emloft.net> 2008-09-11 15:04
> From: Vegard Nossum <vegard.nossum@...il.com>
> Thomas, please review.
>
> > diff --git a/include/net/netlink.h b/include/net/netlink.h
> > index 18024b8..208fe5a 100644
> > --- a/include/net/netlink.h
> > +++ b/include/net/netlink.h
> > @@ -702,7 +702,7 @@ static inline int nla_len(const struct nlattr *nla)
> > */
> > static inline int nla_ok(const struct nlattr *nla, int remaining)
> > {
> > - return remaining >= sizeof(*nla) &&
> > + return remaining >= (int) sizeof(*nla) &&
> > nla->nla_len >= sizeof(*nla) &&
> > nla->nla_len <= remaining;
> > }
Very nice catch, would never have thought of that.
--
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