diff options
| author | Yichong Chen <chenyichong@uniontech.com> | 2026-07-30 15:06:48 +0800 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2026-07-30 11:54:53 +0200 |
| commit | 17463fe751309330b74618560f181426f643aa3d (patch) | |
| tree | bc0f4fe9f22d1da1e2db3edb15ba09c8d2091603 /scripts | |
| parent | 44afeafb8847a8487940cf1f3480108db51e2b41 (diff) | |
| download | linux-stable-17463fe751309330b74618560f181426f643aa3d.tar.gz linux-stable-17463fe751309330b74618560f181426f643aa3d.zip | |
fanotify: stop permission watchdog when timeout is zero
The fanotify permission watchdog can be disabled by writing zero to
fs/fanotify/watchdog_timeout. fanotify_perm_watchdog_group_add() already
checks for a zero timeout before scheduling the watchdog.
However, once the watchdog work has been scheduled, perm_group_watchdog()
unconditionally schedules itself again with the current timeout. If the
sysctl is changed to zero while the work is active, secs_to_jiffies(0)
causes the work to be rescheduled immediately, resulting in a kworker
busy loop.
Read the timeout once in perm_group_watchdog_schedule() and do not
schedule the work when it is zero. This lets a running watchdog stop
after the next execution when the sysctl is set to zero.
Fixes: b8cf8fda522d ("fanotify: add watchdog for permission events")
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Link: https://patch.msgid.link/20260730070648.549458-1-chenyichong@uniontech.com
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
