From nobody Mon Sep 28 07:24:38 2026 Received: from azure-sdnproxy.icoremail.net (azure-sdnproxy.icoremail.net [207.46.229.174]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FE5525CC79 for ; Tue, 25 Aug 2026 07:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=207.46.229.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787641414; cv=none; b=Udm4lbdpjekmCPDoO9HT5HzShleEQGQ3dH55VxBt/wd4DagnOkp/Zyq57tSTTInypthnAc8vDidnn5MpJGF0XgpBn9mIua9exYVv2OGQE0rzRsTsR2KpnhQf888lfwg9j/gcefbiUwXTqm0HdK+i/zyiKhLVQCseTRFzORcm/nc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787641414; c=relaxed/simple; bh=uhBLbYgoEKFnTZ3tlLCppuO/kmCyYC02TdpfRHa+cuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jybOSK2RbitvxAaP197GKV9aaNdYQB22rhYXABbHHSmD9Yv4R6yHLsOxkzXIzO5TDNKpvLr0Bgmj1+T19qq/mkNfhfOrKm4jx4d8Cd5lOO8ScoMjyNSgmBvmjuCm3CucDqYngB4JjNgmHw4Mu9Z4k56EGQf52E5OgqkXtcpDtf8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn; spf=pass smtp.mailfrom=zju.edu.cn; arc=none smtp.client-ip=207.46.229.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zju.edu.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zju.edu.cn Received: from zju.edu.cn (unknown [10.190.160.162]) by mtasvr (Coremail) with SMTP id _____wBHMT81Po1qGuDAAA--.2593S3; Tue, 25 Aug 2026 15:03:18 +0800 (CST) Received: from 192.168.5.38 (unknown [10.190.160.162]) by mail-app3 (Coremail) with SMTP id zS_KCgCXrW81Po1qO4iqBA--.34163S2; Tue, 25 Aug 2026 15:03:17 +0800 (CST) From: Jiacheng Xu To: Tejun Heo Cc: Lai Jiangshan , linux-kernel@vger.kernel.org, Jiacheng Xu Subject: [PATCH RESEND] workqueue: reject watchdog thresholds that overflow jiffies Date: Tue, 25 Aug 2026 15:03:15 +0800 Message-ID: <20260825070315.75540-1-stitch@zju.edu.cn> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260825064805.70744-1-stitch@zju.edu.cn> References: <20260825064805.70744-1-stitch@zju.edu.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: zS_KCgCXrW81Po1qO4iqBA--.34163S2 X-CM-SenderInfo: qtrxiiaqttimo62m3hxhgxhubq/ X-CM-DELIVERINFO: =?B?PUo0NQXKKxbFmtjJiESix3B1w3tMoM3snk/k5SVzZVydjEqe1eefKHnLf95EnB4iem egWzO/wNhIP+pglnkLd0BnOsfhPvQacUjmY6v4xjCA2qAJGeyoqGmTSGIEVH1ke8GQT3no U3dRTf6DQ2Sf+07LI5eSpid9BSXWlB9bGTFtkzH9 X-Coremail-Antispam: 1Uk129KBj9xXoWruryxZFyxtF4DuF4xtFWkAFc_yoWDGwb_Wa 429rnFgw4Ykr1Y9a47Ka15Xry8Zr1UXF10kayrKFW7ta4kKrW5JrZ3CryF9wnrWas8Jrn8 Zwn0ga90gwnxuosvyTuYvTs0mTUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUbskYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7xvr2IYc2Ij64 vIr40E4x8a64kEw24l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2Iq xVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r 126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY 6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67 AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuY vjxU26pBDUUUU Content-Type: text/plain; charset="utf-8" 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 --- kernel/workqueue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index bfeef512f6dd..3ea568807f26 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -8026,6 +8026,9 @@ static int wq_watchdog_param_set_thresh(const char *v= al, if (ret) return ret; + if (thresh > MAX_JIFFY_OFFSET / HZ) + return -ERANGE; + if (system_percpu_wq) wq_watchdog_set_thresh(thresh); else -- 2.25.1