PM: hibernate: Split off snapshot dev option
authorDomenico Andreoli <domenico.andreoli@linux.com>
Thu, 7 May 2020 07:19:53 +0000 (09:19 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 19 May 2020 15:48:08 +0000 (17:48 +0200)
Make it possible to reduce the attack surface in case the snapshot
device is not to be used from userspace.

Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/Kconfig
kernel/power/Makefile

index c208566c844b09a6c04c6cebfcb87400d5a65af0..4d0e6e815a2be145beabda317fc7097b0ac878fb 100644 (file)
@@ -80,6 +80,18 @@ config HIBERNATION
 
          For more information take a look at <file:Documentation/power/swsusp.rst>.
 
+config HIBERNATION_SNAPSHOT_DEV
+       bool "Userspace snapshot device"
+       depends on HIBERNATION
+       default y
+       ---help---
+         Device used by the uswsusp tools.
+
+         Say N if no snapshotting from userspace is needed, this also
+         reduces the attack surface of the kernel.
+
+         If in doubt, say Y.
+
 config PM_STD_PARTITION
        string "Default resume partition"
        depends on HIBERNATION
index e7e47d9be1e56108e8f57bebad7760dcb173dbf1..5899260a8bef4b24f4292aa555b201e1147b9b3c 100644 (file)
@@ -10,7 +10,8 @@ obj-$(CONFIG_VT_CONSOLE_SLEEP)        += console.o
 obj-$(CONFIG_FREEZER)          += process.o
 obj-$(CONFIG_SUSPEND)          += suspend.o
 obj-$(CONFIG_PM_TEST_SUSPEND)  += suspend_test.o
-obj-$(CONFIG_HIBERNATION)      += hibernate.o snapshot.o swap.o user.o
+obj-$(CONFIG_HIBERNATION)      += hibernate.o snapshot.o swap.o
+obj-$(CONFIG_HIBERNATION_SNAPSHOT_DEV) += user.o
 obj-$(CONFIG_PM_AUTOSLEEP)     += autosleep.o
 obj-$(CONFIG_PM_WAKELOCKS)     += wakelock.o