linux/drivers/pci
Serge E. Hallyn 3486740a4f userns: security: make capabilities relative to the user namespace
- Introduce ns_capable to test for a capability in a non-default
  user namespace.
- Teach cap_capable to handle capabilities in a non-default
  user namespace.

The motivation is to get to the unprivileged creation of new
namespaces.  It looks like this gets us 90% of the way there, with
only potential uid confusion issues left.

I still need to handle getting all caps after creation but otherwise I
think I have a good starter patch that achieves all of your goals.

Changelog:
	11/05/2010: [serge] add apparmor
	12/14/2010: [serge] fix capabilities to created user namespaces
	Without this, if user serge creates a user_ns, he won't have
	capabilities to the user_ns he created.  THis is because we
	were first checking whether his effective caps had the caps
	he needed and returning -EPERM if not, and THEN checking whether
	he was the creator.  Reverse those checks.
	12/16/2010: [serge] security_real_capable needs ns argument in !security case
	01/11/2011: [serge] add task_ns_capable helper
	01/11/2011: [serge] add nsown_capable() helper per Bastian Blank suggestion
	02/16/2011: [serge] fix a logic bug: the root user is always creator of
		    init_user_ns, but should not always have capabilities to
		    it!  Fix the check in cap_capable().
	02/21/2011: Add the required user_ns parameter to security_capable,
		    fixing a compile failure.
	02/23/2011: Convert some macros to functions as per akpm comments.  Some
		    couldn't be converted because we can't easily forward-declare
		    them (they are inline if !SECURITY, extern if SECURITY).  Add
		    a current_user_ns function so we can use it in capability.h
		    without #including cred.h.  Move all forward declarations
		    together to the top of the #ifdef __KERNEL__ section, and use
		    kernel-doc format.
	02/23/2011: Per dhowells, clean up comment in cap_capable().
	02/23/2011: Per akpm, remove unreachable 'return -EPERM' in cap_capable.

(Original written and signed off by Eric;  latest, modified version
acked by him)

[akpm@linux-foundation.org: fix build]
[akpm@linux-foundation.org: export current_user_ns() for ecryptfs]
[serge.hallyn@canonical.com: remove unneeded extra argument in selinux's task_has_capability]
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Daniel Lezcano <daniel.lezcano@free.fr>
Acked-by: David Howells <dhowells@redhat.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-03-23 19:47:02 -07:00
..
hotplug PCI hotplug: acpiphp: set current_state to D0 in register_slot 2011-03-04 10:42:22 -08:00
pcie PCI: aer-inject: Override PCIe AER Mask Registers 2011-03-04 10:41:02 -08:00
.gitignore
Kconfig PCI: Export ACPI _DSM provided firmware instance number and string name to sysfs 2011-03-04 10:41:56 -08:00
Makefile Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2011-03-18 10:56:44 -07:00
access.c
bus.c
dmar.c
hotplug-pci.c
hotplug.c
htirq.c
intel-iommu.c
intr_remapping.c
intr_remapping.h
ioapic.c
iov.c
iova.c
irq.c
msi.c
msi.h
pci-acpi.c
pci-driver.c PM: Remove CONFIG_PM_OPS 2011-03-15 00:43:15 +01:00
pci-label.c PCI: label: remove #include of ACPI header to avoid warnings 2011-03-16 10:24:34 -07:00
pci-stub.c
pci-sysfs.c userns: security: make capabilities relative to the user namespace 2011-03-23 19:47:02 -07:00
pci.c
pci.h PCI: Export ACPI _DSM provided firmware instance number and string name to sysfs 2011-03-04 10:41:56 -08:00
probe.c PCI: Avoid potential NULL pointer dereference in pci_scan_bridge 2011-02-08 13:08:05 -08:00
proc.c
quirks.c PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH 2011-03-04 10:42:32 -08:00
remove.c
rom.c
search.c
setup-bus.c PCI: pre-allocate additional resources to devices only after successful allocation of essential resources. 2011-03-04 10:46:47 -08:00
setup-irq.c
setup-res.c
slot.c
syscall.c
vpd.c
xen-pcifront.c pci/xen: Cleanup: convert int** to int[] 2011-02-18 12:41:49 -05:00