[PATCH] net: sched: integer overflow fix
Subsystems:
networking [general] , tc subsystem , the rest
STALE4985d
3 messages,
3 authors,
2012-12-22 · open the first message on its own page
Fixed integer overflow in function htb_dequeue
Signed-off-by: Stefan Hasko <redacted>
---
net/sched/sch_htb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index d2922c0..1bd3faa 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c @@ -919,7 +919,7 @@ ok:
q -> now = ktime_to_ns ( ktime_get ());
start_at = jiffies ;
- next_event = q -> now + 5 * NSEC_PER_SEC ;
+ next_event = q -> now + ( u32 ) 5 * NSEC_PER_SEC ;
for ( level = 0 ; level < TC_HTB_MAXDEPTH ; level ++ ) {
/* common case optimization - skip event handler quickly */ --
1.7.10.4
On Fri, 2012-12-21 at 21:39 +0100, Stefan Hasko wrote: quoted hunk Fixed integer overflow in function htb_dequeue
Signed-off-by: Stefan Hasko <redacted>
---
net/sched/sch_htb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index d2922c0..1bd3faa 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c @@ -919,7 +919,7 @@ ok:
q -> now = ktime_to_ns ( ktime_get ());
start_at = jiffies ;
- next_event = q -> now + 5 * NSEC_PER_SEC ;
+ next_event = q -> now + ( u32 ) 5 * NSEC_PER_SEC ;
for ( level = 0 ; level < TC_HTB_MAXDEPTH ; level ++ ) {
/* common case optimization - skip event handler quickly */
But this patch is wrong !
I am a bit surprised, as I remember spotting this error in one patch
submission from Vimalkumar.
Apparently it got lost.
Please fix the bug for good, not adding another one.
Thanks
On Fri, 2012-12-21 at 14:51 -0800, Eric Dumazet wrote: On Fri, 2012-12-21 at 21:39 +0100, Stefan Hasko wrote: quoted Fixed integer overflow in function htb_dequeue
Signed-off-by: Stefan Hasko <redacted>
---
net/sched/sch_htb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index d2922c0..1bd3faa 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c @@ -919,7 +919,7 @@ ok:
q -> now = ktime_to_ns ( ktime_get ());
start_at = jiffies ;
- next_event = q -> now + 5 * NSEC_PER_SEC ;
+ next_event = q -> now + ( u32 ) 5 * NSEC_PER_SEC ;
for ( level = 0 ; level < TC_HTB_MAXDEPTH ; level ++ ) {
/* common case optimization - skip event handler quickly */
But this patch is wrong !
Please resend your patch using something like
It will work much better.
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index d2922c0..51561ea 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c @@ -919,7 +919,7 @@ ok:
q -> now = ktime_to_ns ( ktime_get ());
start_at = jiffies ;
- next_event = q -> now + 5 * NSEC_PER_SEC ;
+ next_event = q -> now + 5L LU * NSEC_PER_SEC ;
for ( level = 0 ; level < TC_HTB_MAXDEPTH ; level ++ ) {
/* common case optimization - skip event handler quickly */