From a688ac13532252c1125ae8af6a190531d618ed8a Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 21 Jul 2020 14:26:17 +0200 Subject: sys/linux: disable SNAPSHOT_POWER_OFF It causes shutdowns. --- sys/linux/init.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/linux/init.go') diff --git a/sys/linux/init.go b/sys/linux/init.go index f7525583b..928ba17e5 100644 --- a/sys/linux/init.go +++ b/sys/linux/init.go @@ -24,6 +24,7 @@ func InitTarget(target *prog.Target) { FIFREEZE: target.GetConst("FIFREEZE"), FITHAW: target.GetConst("FITHAW"), SNAPSHOT_FREEZE: target.GetConst("SNAPSHOT_FREEZE"), + SNAPSHOT_POWER_OFF: target.GetConst("SNAPSHOT_POWER_OFF"), EXT4_IOC_SHUTDOWN: target.GetConst("EXT4_IOC_SHUTDOWN"), EXT4_IOC_RESIZE_FS: target.GetConst("EXT4_IOC_RESIZE_FS"), EXT4_IOC_MIGRATE: target.GetConst("EXT4_IOC_MIGRATE"), @@ -122,6 +123,7 @@ type arch struct { FIFREEZE uint64 FITHAW uint64 SNAPSHOT_FREEZE uint64 + SNAPSHOT_POWER_OFF uint64 EXT4_IOC_SHUTDOWN uint64 EXT4_IOC_RESIZE_FS uint64 EXT4_IOC_MIGRATE uint64 @@ -242,6 +244,9 @@ func (arch *arch) neutralizeIoctl(c *prog.Call) { case arch.SNAPSHOT_FREEZE: // SNAPSHOT_FREEZE freezes all processes and leaves the machine dead. cmd.Val = arch.FITHAW + case arch.SNAPSHOT_POWER_OFF: + // SNAPSHOT_POWER_OFF shuts down the machine. + cmd.Val = arch.FITHAW case arch.EXT4_IOC_SHUTDOWN: // EXT4_IOC_SHUTDOWN on root fs effectively brings the machine down in weird ways. // Fortunately, the value does not conflict with any other ioctl commands for now. -- cgit mrf-deployment