From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D6763876CF for ; Fri, 19 Jun 2026 13:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781874816; cv=none; b=hqbXsYxKxaf9l/GpZUixS8UEDAQT9HZl896ayoPJgk+f8Ms/RKasaSD9cVzq+oBYrcME6MK9NC9bAskEVqMo9bLGMsqPFswu8MfEiCQaczqJGdgVThDdTPAlTaKrdt7UjUeZfjAS8MK7/04qBlxxvTmziri6xEsgXcF1GNLanv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781874816; c=relaxed/simple; bh=G6dWOTPzVgKCkRqgSTuBro72KlVYriIo5Jeb96y5eKE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=cWW8zkhGDrnOUkAmC/MxZRiMrgZx5cyIXVGrftEhEGTyj68yD1xp9f/UwBoq5enWqMHYa2UNsPZnTbfyX3F/rH4I0buwkv0sLfbQRrV02HejaaZqL7PNxJOH4iLZoHoBdaT+mIJCmJe2i4Cjg2e4hfCG1stO7PpRULWo+S7ttac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d69elKji; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d69elKji" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2c40397e746so13261375ad.3 for ; Fri, 19 Jun 2026 06:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781874814; x=1782479614; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GDqbv3KYc16NoV84WCv9z4I0VD8wqaBB3ezgdXKzyJE=; b=d69elKjiwPkzV88CxWCCr78BCq5Vkggj9AS1E2gXFJw9CMUjdg8i70JlpxIj04MP46 OW2mBHOfuX1Bijk/tz3dxjkEQhRE/DN8+/rvHKhJUH0hGd7SeHwPaIQCI4f3zPws/Rc6 ngTcKOlhgphWjW3YORQajVoe6GQpYWE6nE82B4OijA/Hcoq7he2/EeSQTJfWIRX8kJBg zFVxU0uZPWQ0H8NnPgWvZ4IgTnU1p3vcQUSjaHR1BzQmaawBoh3cCDlGqflbvLthO6wj wgvIdWyruHxkxTay1AMq5BmYrMAafYvk9hawqjMM7P4RNbOWJd8Bq6sfOgp6yRoU6bwS UnbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781874814; x=1782479614; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GDqbv3KYc16NoV84WCv9z4I0VD8wqaBB3ezgdXKzyJE=; b=sJPrrft0+MUz2Uu+W6GJIjsQHP5JkeTAsmAYv7JBqKnelN+tavJM/4kMfpKiKo76Ff Jp6FVrjwM4hYXkSYFLrFoIjk6RoEcoVmfS2g+SrCSE1CDc26ums1YIhprDxzKir2VuH6 +ZZbLg4cGjfVtWvNicrIv7Epeep5NSvYys2/xZdIL57NkAfFWuYzEYipWh42GOYuJ+QF VjcE5CDbD/jdyZrdOxUaXy3IMNDEX+3tVeM7BrU/PgoYX6Ezgcz268ps8uyWns+7+8sG 9h+qQD24V5hpo3AVl2sBxsuQ3ZpsbD8BFGuTArla+fJVSXlSuaFrqzpeyfdgckudu1Nl vWjg== X-Forwarded-Encrypted: i=1; AFNElJ92yxcbVFyYCRXmwPJciO8ctwB7wmXfCqidtNb1sVzl3bPTC9Pm5ds2qsoBUzIMdWpF0WXx9MNpjR3S2Oo=@vger.kernel.org X-Gm-Message-State: AOJu0YxjyHI7pcJsiu0GuiacrV5swtu7B82ZZw9LZ+b70dOiDnYYubxP Tg/qWMaOaqtT15ckW/n+DsEusfpUz4/n6Ulx62HkcBgL29FO8LpyskSFlKofCbfqEOw= X-Gm-Gg: AfdE7cnFRCK2vB5bcfAqgujTJQfgtaXSDGHoe0o84+U1R7drij/cZRajJZoTYNjeEjF HhBwapRKl0JCc+Ivj2uvjYg7Uzxop6zpBwslEigTpdSf7ZWwY+K5SR1raSo9VgHEzF620r1D0tg +jqxshJAFmB17ltOW2Jzap3jcD6kHqV9gvXAQEjcKHCjPo5jObiRGTZ9P4QB0kniCe0u8X+Whjv So/ZDVrQs+TVRHtoWRUCUor9p3kDwBX+CynIdRl9yPxjGCClCB/XHqkBfPQlzdEUQ+Z8aWKPrzg aH/UgV1gaL1qceHmE3E7yXUUmUdOp7vEIK0aW4hY3JobxDsOCvk3JHXvZoMfYE+gP5Z31EDSnJV DhCWndjla5eA0mxfeE8SX3/VLhINvMJjA28Lu2A84NqyY8nceYZVhWIlJ8FEQutxDMm2QPiC+tD rp1k+QRjVa1gGMAYcYH3F5swD9VtWllSV/cssGOP8mYQ== X-Received: by 2002:a17:902:f54a:b0:2bf:9760:b94d with SMTP id d9443c01a7336-2c718f483f2mr40996155ad.15.1781874814281; Fri, 19 Jun 2026 06:13:34 -0700 (PDT) Received: from volcano9b0c-hostos.amd.com ([165.204.217.251]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c7316d44a3sm19663945ad.13.2026.06.19.06.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2026 06:13:33 -0700 (PDT) From: Surya Sai Madhu To: tglx@linutronix.de Cc: anna-maria@linutronix.de, frederic@kernel.org, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, Surya Sai Madhu , syzbot+5e8dda76ca21dae314b6@syzkaller.appspotmail.com Subject: [PATCH] hrtimer: Fix missing debug object calls in in-place update path Date: Fri, 19 Jun 2026 21:13:26 +0800 Message-ID: <20260619131326.125730-1-suryasaimadhu369@gmail.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Commit 343f2f4dc542 ("hrtimer: Try to modify timers in place") introduced an optimization that updates the timer expiry in-place without dequeuing and re-enqueuing it when the new expiry falls within the range of neighbouring timers. However, the in-place path skips debug_hrtimer_deactivate() and debug_hrtimer_activate() calls, leaving the ODEBUG state machine out of sync. When ODEBUG subsequently sees the timer in an unexpected state, hrtimer_fixup_assert_init() fires and installs stub_timer() as the callback. When the timer then expires, stub_timer() hits WARN_ON(1) causing a kernel panic. Fix this by adding the missing debug object deactivate/activate calls in the in-place update path. Reported-by: syzbot+5e8dda76ca21dae314b6@syzkaller.appspotmail.com Fixes: 343f2f4dc542 ("hrtimer: Try to modify timers in place") Signed-off-by: suryasaimadhu --- Note: Please consider this submission. Previous sends had email configuration issues and were sent from the wrong address. kernel/time/hrtimer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 638ce623c342..f60f109a299a 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1243,6 +1243,8 @@ remove_and_enqueue_same_base(struct hrtimer *timer, struct hrtimer_clock_base *b /* Try to update in place to avoid the de/enqueue dance */ if (hrtimer_can_update_in_place(timer, base, expires)) { hrtimer_set_expires_range_ns(timer, expires, delta_ns); + debug_hrtimer_deactivate(timer); + debug_hrtimer_activate(timer, mode); trace_hrtimer_start(timer, mode, true); if (was_first) base->expires_next = expires; -- 2.47.3