All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-18 21:32 ` Matthew Garrett
  0 siblings, 0 replies; 168+ messages in thread
From: Matthew Garrett @ 2013-03-18 21:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-security-module, linux-efi, kexec, linux-pci, Matthew Garrett

Caring about protecting the kernel from UID 0 was previously relatively
uninteresting, since an attacker could simply modify the kernel, a module
or an earlier part of the boot chain in order to insert new code. However,
there are now a range of widely-deployed mechanisms for ensuring the
authenticity of the early boot process and kernel. The addition of module
signing makes most of these attacks infeasible.

This means we can return our focus to the kernel. There's currently a number
of kernel interfaces that permit privileged userspace to modify the running
kernel. These are currently protected by CAP_SYS_RAWIO, but unfortunately
the semantics of this capability are poorly defined and it now covers a large
superset of the desired behaviour.

This patch introduces CAP_COMPROMISE_KERNEL. Holding this capability
indicates that a process is empowered to perform tasks that may result in
modification of the running kernel. While aimed at handling the specific
use-case of Secure Boot, it is generalisable to any other environment where
permitting userspace to modify the kernel is undesirable.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
---
 include/uapi/linux/capability.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/capability.h b/include/uapi/linux/capability.h
index ba478fa..7109e650 100644
--- a/include/uapi/linux/capability.h
+++ b/include/uapi/linux/capability.h
@@ -343,7 +343,11 @@ struct vfs_cap_data {
 
 #define CAP_BLOCK_SUSPEND    36
 
-#define CAP_LAST_CAP         CAP_BLOCK_SUSPEND
+/* Allow things that trivially permit root to modify the running kernel */
+
+#define CAP_COMPROMISE_KERNEL  37
+
+#define CAP_LAST_CAP         CAP_COMPROMISE_KERNEL
 
 #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
 
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 168+ messages in thread
* Re: [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-20  1:07 ` Matthew Garrett
  0 siblings, 0 replies; 168+ messages in thread
From: Matthew Garrett @ 2013-03-20  1:07 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, linux-security-module, linux-efi, kexec, linux-pci

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 314 bytes --]

Yeah, I'd like the option of relaxing restrictions when drivers explicitly opt in based on iommu support.
-- 
Matthew Garrett | matthew.garrett@nebula.comÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 168+ messages in thread
* Re: [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-20  1:09 ` Matthew Garrett
  0 siblings, 0 replies; 168+ messages in thread
From: Matthew Garrett @ 2013-03-20  1:09 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, linux-security-module, linux-efi, kexec, linux-pci

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 508 bytes --]

The cases I'd looked at seemed to mostly involve obsolete hardware or only allow command submission to SCSI targets, so I wasn't too worried about them - but, like I said, I've no inherent objection to using CAP_SYS_RAWIO as long as we modify any cases where userspace really does need that access. 
-- 
Matthew Garrett | matthew.garrett@nebula.comÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 168+ messages in thread
* Re: [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-20  1:28 ` Matthew Garrett
  0 siblings, 0 replies; 168+ messages in thread
From: Matthew Garrett @ 2013-03-20  1:28 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel, linux-security-module, linux-efi, kexec, linux-pci

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 497 bytes --]

Mm. The question is whether we can reliably determine the ranges a device should be able to access without having to trust userspace (and, ideally, without having to worry about whether iommu vendors have done their job). It's pretty important for PCI passthrough, so we do need to care. 
-- 
Matthew Garrett | matthew.garrett@nebula.comÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 168+ messages in thread
* Re: [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-21 16:32 ` Matthew Garrett
  0 siblings, 0 replies; 168+ messages in thread
From: Matthew Garrett @ 2013-03-21 16:32 UTC (permalink / raw)
  To: Serge E. Hallyn
  Cc: Vivek Goyal, Mimi Zohar, James Morris, linux-kernel,
	linux-security-module, linux-efi, kexec, linux-pci

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 238 bytes --]

Revocation is in the kernel. 
-- 
Matthew Garrett | matthew.garrett@nebula.comÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

end of thread, other threads:[~2013-03-28 12:46 UTC | newest]

Thread overview: 168+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-18 21:32 [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL Matthew Garrett
2013-03-18 21:32 ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 02/12] SELinux: define mapping for CAP_COMPROMISE_KERNEL Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 03/12] Secure boot: Add a dummy kernel parameter that will switch on Secure Boot mode Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 04/12] efi: Enable secure boot lockdown automatically when enabled in firmware Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 05/12] PCI: Require CAP_COMPROMISE_KERNEL for PCI BAR access Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-27 15:03   ` Josh Boyer
2013-03-27 15:03     ` Josh Boyer
2013-03-27 15:08     ` Kyle McMartin
2013-03-27 15:08       ` Kyle McMartin
2013-03-28 12:46       ` Josh Boyer
2013-03-28 12:46         ` Josh Boyer
2013-03-18 21:32 ` [PATCH 06/12] x86: Require CAP_COMPROMISE_KERNEL for IO port access Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-20  1:00   ` H. Peter Anvin
2013-03-20  1:00     ` H. Peter Anvin
2013-03-18 21:32 ` [PATCH 07/12] ACPI: Limit access to custom_method Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 08/12] asus-wmi: Restrict debugfs interface Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 09/12] Require CAP_COMPROMISE_KERNEL for /dev/mem and /dev/kmem access Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 10/12] acpi: Ignore acpi_rsdp kernel parameter in a secure boot environment Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-19  8:47   ` Dave Young
2013-03-19  8:47     ` Dave Young
2013-03-19  8:47     ` Dave Young
2013-03-19 11:19     ` Josh Boyer
2013-03-19 11:19       ` Josh Boyer
2013-03-19 11:19       ` Josh Boyer
2013-03-19 17:07       ` [PATCH v2] " Josh Boyer
2013-03-19 17:07         ` Josh Boyer
2013-03-18 21:32 ` [PATCH 11/12] x86: Require CAP_COMPROMISE_KERNEL for MSR writing Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32 ` [PATCH 12/12] kexec: Require CAP_SYS_COMPROMISE_KERNEL Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-18 21:32   ` Matthew Garrett
2013-03-19  4:47 ` [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL James Morris
2013-03-19  4:47   ` James Morris
2013-03-19  4:47   ` James Morris
2013-03-20  1:03   ` H. Peter Anvin
2013-03-20  1:03     ` H. Peter Anvin
2013-03-20 16:41   ` Mimi Zohar
2013-03-20 16:41     ` Mimi Zohar
2013-03-20 16:49     ` Matthew Garrett
2013-03-20 16:49       ` Matthew Garrett
2013-03-20 16:49       ` Matthew Garrett
2013-03-20 16:49       ` Matthew Garrett
2013-03-20 18:01       ` Mimi Zohar
2013-03-20 18:01         ` Mimi Zohar
2013-03-20 18:01         ` Mimi Zohar
2013-03-20 18:12         ` Matthew Garrett
2013-03-20 18:12           ` Matthew Garrett
2013-03-20 18:12           ` Matthew Garrett
2013-03-20 18:12           ` Matthew Garrett
2013-03-20 19:16           ` Mimi Zohar
2013-03-20 19:16             ` Mimi Zohar
2013-03-20 19:16             ` Mimi Zohar
2013-03-20 19:16             ` Mimi Zohar
2013-03-20 20:37             ` Matthew Garrett
2013-03-20 20:37               ` Matthew Garrett
2013-03-20 20:37               ` Matthew Garrett
2013-03-20 20:37               ` Matthew Garrett
2013-03-20 21:11               ` Mimi Zohar
2013-03-20 21:11                 ` Mimi Zohar
2013-03-20 21:11                 ` Mimi Zohar
2013-03-20 21:18                 ` Matthew Garrett
2013-03-20 21:18                   ` Matthew Garrett
2013-03-20 21:18                   ` Matthew Garrett
2013-03-20 21:18                   ` Matthew Garrett
2013-03-21 13:43                   ` Vivek Goyal
2013-03-21 13:43                     ` Vivek Goyal
2013-03-21 13:43                     ` Vivek Goyal
2013-03-21 13:43                     ` Vivek Goyal
2013-03-21 15:37                     ` Serge E. Hallyn
2013-03-21 15:37                       ` Serge E. Hallyn
2013-03-21 15:37                       ` Serge E. Hallyn
2013-03-21 15:37                       ` Serge E. Hallyn
2013-03-21 15:52                       ` Vivek Goyal
2013-03-21 15:52                         ` Vivek Goyal
2013-03-21 15:52                         ` Vivek Goyal
2013-03-21 15:52                         ` Vivek Goyal
2013-03-21 15:58                         ` Serge E. Hallyn
2013-03-21 15:58                           ` Serge E. Hallyn
2013-03-21 15:58                           ` Serge E. Hallyn
2013-03-21 15:58                           ` Serge E. Hallyn
2013-03-21 16:04                           ` Vivek Goyal
2013-03-21 16:04                             ` Vivek Goyal
2013-03-21 16:04                             ` Vivek Goyal
2013-03-21 16:19                             ` Serge E. Hallyn
2013-03-21 16:19                               ` Serge E. Hallyn
2013-03-21 16:19                               ` Serge E. Hallyn
2013-03-21 16:19                               ` Serge E. Hallyn
2013-03-21 17:15                               ` Vivek Goyal
2013-03-21 17:15                                 ` Vivek Goyal
2013-03-21 17:15                                 ` Vivek Goyal
2013-03-21 17:15                                 ` Vivek Goyal
2013-03-21  1:58     ` James Morris
2013-03-21  1:58       ` James Morris
2013-03-19  7:18 ` Yves-Alexis Perez
2013-03-19  7:18   ` Yves-Alexis Perez
2013-03-20  1:02 ` H. Peter Anvin
2013-03-20  1:02   ` H. Peter Anvin
2013-03-20  1:05   ` H. Peter Anvin
2013-03-20  1:05     ` H. Peter Anvin
2013-03-20 13:15   ` Matthew Garrett
2013-03-20 13:15     ` Matthew Garrett
2013-03-20 13:15     ` Matthew Garrett
2013-03-20 13:15     ` Matthew Garrett
2013-03-20 15:03     ` H. Peter Anvin
2013-03-20 15:03       ` H. Peter Anvin
2013-03-20 15:03       ` H. Peter Anvin
2013-03-20 15:03       ` H. Peter Anvin
2013-03-20 15:14       ` Matthew Garrett
2013-03-20 15:14         ` Matthew Garrett
2013-03-20 15:14         ` Matthew Garrett
2013-03-20 15:14         ` Matthew Garrett
2013-03-20 16:45         ` H. Peter Anvin
2013-03-20 16:45           ` H. Peter Anvin
2013-03-20 16:45           ` H. Peter Anvin
2013-03-20  1:07 Matthew Garrett
2013-03-20  1:07 ` Matthew Garrett
2013-03-20  1:07 ` Matthew Garrett
2013-03-20  1:07 ` Matthew Garrett
2013-03-20  1:11 ` H. Peter Anvin
2013-03-20  1:11   ` H. Peter Anvin
2013-03-20  1:11   ` H. Peter Anvin
2013-03-20  1:11   ` H. Peter Anvin
2013-03-20  1:09 Matthew Garrett
2013-03-20  1:09 ` Matthew Garrett
2013-03-20  1:09 ` Matthew Garrett
2013-03-20  1:09 ` Matthew Garrett
2013-03-20  1:28 Matthew Garrett
2013-03-20  1:28 ` Matthew Garrett
2013-03-20  1:28 ` Matthew Garrett
2013-03-20  1:28 ` Matthew Garrett
2013-03-20  2:48 ` H. Peter Anvin
2013-03-20  2:48   ` H. Peter Anvin
2013-03-20  2:48   ` H. Peter Anvin
2013-03-20  3:08   ` H. Peter Anvin
2013-03-20  3:08     ` H. Peter Anvin
2013-03-20  3:08     ` H. Peter Anvin
2013-03-20  3:08     ` H. Peter Anvin
2013-03-20  3:18     ` Alex Williamson
2013-03-20  3:18       ` Alex Williamson
2013-03-20  3:18       ` Alex Williamson
2013-03-20  3:18       ` Alex Williamson
2013-03-20  3:22       ` H. Peter Anvin
2013-03-20  3:22         ` H. Peter Anvin
2013-03-20  3:22         ` H. Peter Anvin
2013-03-20  3:22         ` H. Peter Anvin
2013-03-20  3:27         ` Alex Williamson
2013-03-20  3:27           ` Alex Williamson
2013-03-20  3:27           ` Alex Williamson
2013-03-20  3:27           ` Alex Williamson
2013-03-21 16:32 Matthew Garrett
2013-03-21 16:32 ` Matthew Garrett
2013-03-21 16:32 ` Matthew Garrett
2013-03-21 16:32 ` Matthew Garrett

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.