Re: [syzbot] [kernel?] BUG: soft lockup in gate_timer_func

Edward Adam Davis <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <[email protected]>
#syz test

diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c
index fdbfcaa3e2ab..9065e7b88156 100644
--- a/net/sched/act_gate.c
+++ b/net/sched/act_gate.c
@@ -88,7 +88,8 @@ static enum hrtimer_restart gate_timer_func(struct hrtimer *timer)
 	gact->current_max_octets = next->maxoctets;
 
 	gact->current_close_time = ktime_add_ns(gact->current_close_time,
-						next->interval);
+						next->interval < 100 ?
+						100 : next->interval);
 
 	close_time = gact->current_close_time;
 
@@ -101,10 +102,10 @@ static enum hrtimer_restart gate_timer_func(struct hrtimer *timer)
 	now = gate_get_time(gact);
 
 	if (ktime_after(now, close_time)) {
-		ktime_t cycle, base;
+		u64 cycle, base;
 		u64 n;
 
-		cycle = p->tcfg_cycletime;
+		cycle = p->tcfg_cycletime > 20 ? 20 : p->tcfg_cycletime;
 		base = ns_to_ktime(p->tcfg_basetime);
 		n = div64_u64(ktime_sub_ns(now, base), cycle);
 		close_time = ktime_add_ns(base, (n + 1) * cycle);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.