linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-18 21:32 Matthew Garrett
  2013-03-18 21:32 ` [PATCH 02/12] SELinux: define mapping for CAP_COMPROMISE_KERNEL Matthew Garrett
                   ` (13 more replies)
  0 siblings, 14 replies; 54+ 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] 54+ messages in thread
* Re: [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-20  1:07 Matthew Garrett
  2013-03-20  1:11 ` H. Peter Anvin
  0 siblings, 1 reply; 54+ messages in thread
From: Matthew Garrett @ 2013-03-20  1:07 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org,
	kexec@lists.infradead.org, linux-pci@vger.kernel.org

WWVhaCwgSSdkIGxpa2UgdGhlIG9wdGlvbiBvZiByZWxheGluZyByZXN0cmljdGlvbnMgd2hlbiBk
cml2ZXJzIGV4cGxpY2l0bHkgb3B0IGluIGJhc2VkIG9uIGlvbW11IHN1cHBvcnQuCi0tIApNYXR0
aGV3IEdhcnJldHQgfCBtYXR0aGV3LmdhcnJldHRAbmVidWxhLmNvbQ==


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

VGhlIGNhc2VzIEknZCBsb29rZWQgYXQgc2VlbWVkIHRvIG1vc3RseSBpbnZvbHZlIG9ic29sZXRl
IGhhcmR3YXJlIG9yIG9ubHkgYWxsb3cgY29tbWFuZCBzdWJtaXNzaW9uIHRvIFNDU0kgdGFyZ2V0
cywgc28gSSB3YXNuJ3QgdG9vIHdvcnJpZWQgYWJvdXQgdGhlbSAtIGJ1dCwgbGlrZSBJIHNhaWQs
IEkndmUgbm8gaW5oZXJlbnQgb2JqZWN0aW9uIHRvIHVzaW5nIENBUF9TWVNfUkFXSU8gYXMgbG9u
ZyBhcyB3ZSBtb2RpZnkgYW55IGNhc2VzIHdoZXJlIHVzZXJzcGFjZSByZWFsbHkgZG9lcyBuZWVk
IHRoYXQgYWNjZXNzLiAKLS0gCk1hdHRoZXcgR2FycmV0dCB8IG1hdHRoZXcuZ2FycmV0dEBuZWJ1
bGEuY29t


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

TW0uIFRoZSBxdWVzdGlvbiBpcyB3aGV0aGVyIHdlIGNhbiByZWxpYWJseSBkZXRlcm1pbmUgdGhl
IHJhbmdlcyBhIGRldmljZSBzaG91bGQgYmUgYWJsZSB0byBhY2Nlc3Mgd2l0aG91dCBoYXZpbmcg
dG8gdHJ1c3QgdXNlcnNwYWNlIChhbmQsIGlkZWFsbHksIHdpdGhvdXQgaGF2aW5nIHRvIHdvcnJ5
IGFib3V0IHdoZXRoZXIgaW9tbXUgdmVuZG9ycyBoYXZlIGRvbmUgdGhlaXIgam9iKS4gSXQncyBw
cmV0dHkgaW1wb3J0YW50IGZvciBQQ0kgcGFzc3Rocm91Z2gsIHNvIHdlIGRvIG5lZWQgdG8gY2Fy
ZS4gCi0tIApNYXR0aGV3IEdhcnJldHQgfCBtYXR0aGV3LmdhcnJldHRAbmVidWxhLmNvbQ==


^ permalink raw reply	[flat|nested] 54+ messages in thread
* Re: [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL
@ 2013-03-21 16:32 Matthew Garrett
  0 siblings, 0 replies; 54+ 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@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org,
	kexec@lists.infradead.org, linux-pci@vger.kernel.org

UmV2b2NhdGlvbiBpcyBpbiB0aGUga2VybmVsLiAKLS0gCk1hdHRoZXcgR2FycmV0dCB8IG1hdHRo
ZXcuZ2FycmV0dEBuZWJ1bGEuY29t


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

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

Thread overview: 54+ 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 ` [PATCH 02/12] SELinux: define mapping for CAP_COMPROMISE_KERNEL 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 ` [PATCH 04/12] efi: Enable secure boot lockdown automatically when enabled in firmware Matthew Garrett
2013-03-18 21:32 ` [PATCH 05/12] PCI: Require CAP_COMPROMISE_KERNEL for PCI BAR access Matthew Garrett
2013-03-27 15:03   ` Josh Boyer
2013-03-27 15:08     ` Kyle McMartin
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-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 ` [PATCH 08/12] asus-wmi: Restrict debugfs interface 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 ` [PATCH 10/12] acpi: Ignore acpi_rsdp kernel parameter in a secure boot environment Matthew Garrett
2013-03-19  8:47   ` Dave Young
2013-03-19 11:19     ` Josh Boyer
2013-03-19 17:07       ` [PATCH v2] " 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 ` [PATCH 12/12] kexec: Require CAP_SYS_COMPROMISE_KERNEL Matthew Garrett
2013-03-19  4:47 ` [PATCH 01/12] Security: Add CAP_COMPROMISE_KERNEL James Morris
2013-03-20  1:03   ` H. Peter Anvin
2013-03-20 16:41   ` Mimi Zohar
2013-03-20 16:49     ` Matthew Garrett
2013-03-20 18:01       ` Mimi Zohar
2013-03-20 18:12         ` Matthew Garrett
2013-03-20 19:16           ` Mimi Zohar
2013-03-20 20:37             ` Matthew Garrett
2013-03-20 21:11               ` Mimi Zohar
2013-03-20 21:18                 ` Matthew Garrett
2013-03-21 13:43                   ` Vivek Goyal
2013-03-21 15:37                     ` Serge E. Hallyn
2013-03-21 15:52                       ` Vivek Goyal
2013-03-21 15:58                         ` Serge E. Hallyn
2013-03-21 16:04                           ` Vivek Goyal
2013-03-21 16:19                             ` Serge E. Hallyn
2013-03-21 17:15                               ` Vivek Goyal
2013-03-21  1:58     ` James Morris
2013-03-19  7:18 ` Yves-Alexis Perez
2013-03-20  1:02 ` H. Peter Anvin
2013-03-20  1:05   ` H. Peter Anvin
2013-03-20 13:15   ` Matthew Garrett
2013-03-20 15:03     ` H. Peter Anvin
2013-03-20 15:14       ` Matthew Garrett
2013-03-20 16:45         ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2013-03-20  1:07 Matthew Garrett
2013-03-20  1:11 ` H. Peter Anvin
2013-03-20  1:09 Matthew Garrett
2013-03-20  1:28 Matthew Garrett
2013-03-20  2:48 ` H. Peter Anvin
2013-03-20  3:08   ` H. Peter Anvin
2013-03-20  3:18     ` Alex Williamson
2013-03-20  3:22       ` H. Peter Anvin
2013-03-20  3:27         ` Alex Williamson
2013-03-21 16:32 Matthew Garrett

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).