All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] kexec_load: check CAP_SYS_MODULE
@ 2011-01-06  8:25 ` Amerigo Wang
  0 siblings, 0 replies; 22+ messages in thread
From: Amerigo Wang @ 2011-01-06  8:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: WANG Cong, Eric Biederman, kexec

Eric pointed out that kexec_load() actually allows you to
run any code you want in ring0, this is more like CAP_SYS_MODULE.

Reported-by: Eric Paris <eparis@redhat.com>
Signed-off-by: WANG Cong <amwang@redhat.com>

---
diff --git a/kernel/kexec.c b/kernel/kexec.c
index b55045b..c30d613 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -945,7 +945,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments,
 	int result;
 
 	/* We only trust the superuser with rebooting the system. */
-	if (!capable(CAP_SYS_BOOT))
+	if (!capable(CAP_SYS_BOOT) || !capable(CAP_SYS_MODULE))
 		return -EPERM;
 
 	/*

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

end of thread, other threads:[~2011-01-14 19:47 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-06  8:25 [Patch] kexec_load: check CAP_SYS_MODULE Amerigo Wang
2011-01-06  8:25 ` Amerigo Wang
2011-01-06  8:27 ` Cong Wang
2011-01-06  8:27   ` Cong Wang
2011-01-06  8:47 ` Eric W. Biederman
2011-01-06  8:47   ` Eric W. Biederman
2011-01-06 19:02   ` Eric Paris
2011-01-06 19:02     ` Eric Paris
2011-01-07 20:10     ` Eric W. Biederman
2011-01-07 20:10       ` Eric W. Biederman
2011-01-07 20:32       ` Eric Paris
2011-01-07 20:32         ` Eric Paris
2011-01-07 21:02         ` Eric W. Biederman
2011-01-07 21:02           ` Eric W. Biederman
2011-01-08  0:39           ` Eric Paris
2011-01-08  0:39             ` Eric Paris
2011-01-09  2:09             ` Eric W. Biederman
2011-01-09  2:09               ` Eric W. Biederman
2011-01-11 11:26               ` Cong Wang
2011-01-11 11:26                 ` Cong Wang
2011-01-14 19:47               ` Eric Paris
2011-01-14 19:47                 ` Eric Paris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.