Re: [PATCH] netlink: fix overrun in attribute iteration

From: David Miller
Date: Thu Sep 11 2008 - 22:05:59 EST


From: Thomas Graf <tgraf@xxxxxxx>
Date: Fri, 12 Sep 2008 02:35:23 +0200

> * David Miller <davem@xxxxxxxxxxxxx> 2008-09-11 15:04
> > From: Vegard Nossum <vegard.nossum@xxxxxxxxx>
> > 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.

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/