[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130801223115.59a1ac76@nehalam.linuxnetplumber.net>
Date: Thu, 1 Aug 2013 22:31:15 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [Bug 60669] Kernel panic when using negative priority for HTB
class
On Fri, 2 Aug 2013 04:50:16 +0000 (UTC)
Cong Wang <xiyou.wangcong@...il.com> wrote:
> On Fri, 02 Aug 2013 at 04:12 GMT, Stephen Hemminger <stephen@...workplumber.org> wrote:
> >
> > --- Comment #2 from _Vi <vi0oss@...il.com> ---
> > Reproducible on 3.11.0-rc3
> >
> > Looks like negative priority value is essential for the kernel panic.
> >
>
> There is a check for prio:
>
> if ((cl->prio = hopt->prio) >= TC_HTB_NUMPRIO)
> cl->prio = TC_HTB_NUMPRIO - 1;
>
This maybe related to or old bugs, 64 bit with current
iproute2 the error is caught at the command level.
The issue is that hopt->prio is u32 but cl->prio is int.
Example:
int main()
{
int x = -1;
uint32_t prio = x;
int cl;
if ((cl = prio) >= TC_HTB_NUMPRIO)
cl = TC_HTB_NUMPRIO - 1;
printf("%d %u %d\n", x, prio, cl);
return 0;
}
-1 4294967295 -1
Signed/unsigned conversions can bite.
--
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