Skip to contentSkip to conversation

System reboot triggered by just reading a device file....!?

DISCUSSION [email protected] 2 participants 2 messages Nov 20, 2007

lore
Share & tools
lore
#0 lore raw

good evening,

i stumbled over some funny issue when trying windirstat (like KDirStat) with wine.

after running that tool for a while my system rebooted. i could reproduce this with every run.

after some deep investigation (i thought i had stability issues with my system and spent more than an hour on this) i found out, that the reboot is being triggered by iTCO_wdt ( /dev/watchdog )

this is how to reproduce:

- be root
- cat /dev/watchdog or dd if=/dev/watchdog of=/dev/zero bs=1 count=1 or .....
- wait one minute........

*reboot*!

i have heard 2 opinions for now (contacted the author and also discussed on wine-devel ) that this should be expected behaviour.

being sysadmin quite a while, i cannot believe that (accidentally) reading a device file (being root or not - what does that matter) triggers a system reboot.

ok - when im root , i shouldnt do stupid things and be careful, but i thought reading/crawling trough a filesystem (r/o, btw.) with some tool which is built to do exactly this wasn`t so stupid - even from within wine.

think of an admin writing a quick&dirty script for intrusion detection (find / -exec md5sum {} \; >/tmp/need-no-tripwire) and forgetting to exclude /dev, /sys or /proc appropriately...... think of someone exporting "/" via samba (readonly) and then navigating trough the /dev directory....

stupid?
i don`t think so.....i have seen worse things...... :)

should someone get punished by an accidental system reboot and should he need to spend his time on this to investigate why this happens?

i`d wish there would be some fence around this or iTCO_wdt /dev/watchdog not being active after a default desktop installation.

id be interested if im the only one who thinks this is strange/dangerous behaviour.

regards
roland

_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066

#1 lore raw
Quoted 1 line · On Wed, Nov 21, 2007 at 12:06:57AM +0100, [email protected] wrote:

- be root

That's your first mistake.

Quoted 4 lines
(quoted diff) +0 -2
-  cat /dev/watchdog or dd if=/dev/watchdog of=/dev/zero bs=1 count=1 or .....
-  wait one minute........

*reboot*!

And that's the defined behavior of /dev/watchdog, yes. Many years too late to change it.

Quoted 3 lines

i have heard 2 opinions for now (contacted the author and also discussed on wine-devel ) that this should be expected behaviour.

being sysadmin quite a while, i cannot believe that (accidentally) reading a device file (being root or not - what does that matter) triggers a system reboot.

If /dev/watchdog can be opened by non-root, that's an installation error.

Signature · 1 line
Mathematics is the supreme nostalgia of our time.