From: Guenter Roeck <linux@roeck-us.net>
To: Nhat Tran <nhat.tranminhk2@gmail.com>,
Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: linux-watchdog@vger.kernel.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] watchdog: omap: Do not read the counter while the watchdog is stopped
Date: Fri, 20 Nov 2026 11:20:44 -0800 [thread overview]
Message-ID: <38e5fb82-c883-4e49-9fe4-b77a122a586f@roeck-us.net> (raw)
In-Reply-To: <20261120124009.24264-1-nhat.tranminhk2@gmail.com>
On 11/20/26 04:40, Nhat Tran wrote:
> omap_wdt only holds a runtime PM reference between omap_wdt_start() and
> omap_wdt_stop(), so the module is idle and its clock gated whenever the
> watchdog is not running. omap_wdt_get_timeleft() reads the WCRR register
> unconditionally, but the watchdog core calls ->get_timeleft() from the
> sysfs timeleft attribute without checking whether the watchdog is
> active.
>
> With CONFIG_WATCHDOG_SYSFS=y the attribute is world readable, so any
The watchdog can also be stopped while the watchdog device is open, so the
problem is a bit broader than that.
> unprivileged user can trigger an external abort on a stopped watchdog.
> On a BeagleBone Black (AM335x), with panic_on_oops set:
>
Seems to me the proper generic fix should be in watchdog_get_timeleft(),
which should return either return the configured timeout or maybe 0
(I am open to suggestions) if the watchdog is not running.
Thanks,
Guenter
prev parent reply other threads:[~2026-11-20 19:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 12:40 Nhat Tran
2026-11-20 19:20 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=38e5fb82-c883-4e49-9fe4-b77a122a586f@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=nhat.tranminhk2@gmail.com \
--cc=stable@vger.kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®