7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiacheng Xu [ Upstream commit 068c35b5d0546c8625b3d7c61910f73775cf1216 ] The watchdog threshold is supplied in seconds but is multiplied by HZ before being used as a jiffies interval. Reject values that exceed MAX_JIFFY_OFFSET / HZ so the multiplication cannot wrap and the time_after() comparisons remain within their supported range. The check is performed before changing the threshold or watchdog timer. Zero remains the value used to disable the watchdog. Fixes: 82607adcf9cdf ("workqueue: implement lockup detector") Signed-off-by: Jiacheng Xu Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin --- kernel/workqueue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 929c04a9581bd..36aaeb38e2174 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -7923,6 +7923,9 @@ static int wq_watchdog_param_set_thresh(const char *val, if (ret) return ret; + if (thresh > MAX_JIFFY_OFFSET / HZ) + return -ERANGE; + if (system_percpu_wq) wq_watchdog_set_thresh(thresh); else -- 2.53.0