Base system bug / watchdog

watchdogd(8): the pretimeout option passes 4 bytes to an 8-byte ioctl

A type changed in the kernel header and one caller did not follow.

A bug under a magnifying glass.
Component
usr.sbin/watchdogd/watchdogd.c
Found on
Reading the source
Status
Drafted
Written

In August 2025 the watchdog interface switched to sbintime_t (commit 26d6617f3e5, review D49183 by another developer), and WDIOC_SETPRETIMEOUT now takes 8 bytes. watchdogd still declares static u_int pretimeout and passes its address. The kernel copies 8 bytes, so the pre-timeout it gets is the 4-byte count of seconds plus 4 bytes of whatever sits next to it in memory, and even the right half is in seconds instead of sbintime_t units.

Affects releng/15.0, releng/15.1 and main; stable/14 is not affected. Read from the source, not run. Drafted for Bugzilla.

All kernel bugs

Built with ssg