linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: disable hibernation if module loading is disabled
@ 2011-03-04 16:11 Vasiliy Kulikov
  2011-03-04 18:43 ` Kees Cook
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Vasiliy Kulikov @ 2011-03-04 16:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: security, Len Brown, Pavel Machek, Rafael J. Wysocki, linux-pm

If /proc/sys/kernel/modules_disabled is set to 1, then nobody (even full
root) may not read/write arbitrary kernel memory.  In spite of it,
hibernation allows anyone with an access to either /dev/snapshot or
/sys/power/ make the full snapshot of the system.  This snapshot may be
freely changed and uploaded back.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
---
 kernel/power/hibernate.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 1832bd2..1ac9eee 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -328,6 +328,9 @@ int hibernation_snapshot(int platform_mode)
 {
 	int error;
 
+	if (modules_disabled)
+		return -EPERM;
+
 	error = platform_begin(platform_mode);
 	if (error)
 		goto Close;
@@ -385,6 +388,9 @@ static int resume_target_kernel(bool platform_mode)
 {
 	int error;
 
+	if (modules_disabled)
+		return -EPERM;
+
 	error = dpm_suspend_noirq(PMSG_QUIESCE);
 	if (error) {
 		printk(KERN_ERR "PM: Some devices failed to power down, "
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-03-08  6:59 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04 16:11 [PATCH] power: disable hibernation if module loading is disabled Vasiliy Kulikov
2011-03-04 18:43 ` Kees Cook
2011-03-04 20:48   ` Rafael J. Wysocki
2011-03-04 20:32 ` Pavel Machek
2011-03-04 21:52   ` Vasiliy Kulikov
2011-03-04 20:42 ` Rafael J. Wysocki
2011-03-04 21:10   ` Vasiliy Kulikov
2011-03-04 21:21     ` Rafael J. Wysocki
2011-03-04 21:46       ` Vasiliy Kulikov
2011-03-04 22:30         ` Rafael J. Wysocki
2011-03-04 22:42           ` Pavel Machek
2011-03-05 10:34           ` Vasiliy Kulikov
2011-03-05 11:24             ` Rafael J. Wysocki
2011-03-08  6:58               ` Pavel Machek
2011-03-04 21:27 ` [Security] " Greg KH
2011-03-04 21:51   ` Vasiliy Kulikov
2011-03-06 19:36 ` david

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).