]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'security/next'
authorThierry Reding <treding@nvidia.com>
Thu, 24 Oct 2013 12:36:59 +0000 (14:36 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 24 Oct 2013 12:36:59 +0000 (14:36 +0200)
1  2 
MAINTAINERS
drivers/char/tpm/xen-tpmfront.c
init/Kconfig
security/selinux/hooks.c

diff --combined MAINTAINERS
index 480d77d216200178df0f3c6a2111d4164be49287,936adb4e6b39f591659d13a75f06e57f86bff21a..10a90130579c8f603ff9998e82dca556ee847744
@@@ -237,11 -237,11 +237,11 @@@ F:      drivers/platform/x86/acer-wmi.
  
  ACPI
  M:    Len Brown <lenb@kernel.org>
 -M:    Rafael J. Wysocki <rjw@sisk.pl>
 +M:    Rafael J. Wysocki <rjw@rjwysocki.net>
  L:    linux-acpi@vger.kernel.org
 -W:    http://www.lesswatts.org/projects/acpi/
 -Q:    http://patchwork.kernel.org/project/linux-acpi/list/
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
 +W:    https://01.org/linux-acpi
 +Q:    https://patchwork.kernel.org/project/linux-acpi/list/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
  S:    Supported
  F:    drivers/acpi/
  F:    drivers/pnp/pnpacpi/
@@@ -253,38 -253,24 +253,38 @@@ F:      drivers/pci/*acpi
  F:    drivers/pci/*/*acpi*
  F:    drivers/pci/*/*/*acpi*
  
 +ACPI COMPONENT ARCHITECTURE (ACPICA)
 +M:    Robert Moore <robert.moore@intel.com>
 +M:    Lv Zheng <lv.zheng@intel.com>
 +M:    Rafael J. Wysocki <rafael.j.wysocki@intel.com>
 +L:    linux-acpi@vger.kernel.org
 +L:    devel@acpica.org
 +W:    https://acpica.org/
 +W:    https://github.com/acpica/acpica/
 +Q:    https://patchwork.kernel.org/project/linux-acpi/list/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
 +S:    Supported
 +F:    drivers/acpi/acpica/
 +F:    include/acpi/
 +
  ACPI FAN DRIVER
  M:    Zhang Rui <rui.zhang@intel.com>
  L:    linux-acpi@vger.kernel.org
 -W:    http://www.lesswatts.org/projects/acpi/
 +W:    https://01.org/linux-acpi
  S:    Supported
  F:    drivers/acpi/fan.c
  
  ACPI THERMAL DRIVER
  M:    Zhang Rui <rui.zhang@intel.com>
  L:    linux-acpi@vger.kernel.org
 -W:    http://www.lesswatts.org/projects/acpi/
 +W:    https://01.org/linux-acpi
  S:    Supported
  F:    drivers/acpi/*thermal*
  
  ACPI VIDEO DRIVER
  M:    Zhang Rui <rui.zhang@intel.com>
  L:    linux-acpi@vger.kernel.org
 -W:    http://www.lesswatts.org/projects/acpi/
 +W:    https://01.org/linux-acpi
  S:    Supported
  F:    drivers/acpi/video.c
  
@@@ -838,21 -824,15 +838,21 @@@ S:      Maintaine
  F:    arch/arm/mach-gemini/
  
  ARM/CSR SIRFPRIMA2 MACHINE SUPPORT
 -M:    Barry Song <baohua.song@csr.com>
 +M:    Barry Song <baohua@kernel.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux.git
  S:    Maintained
  F:    arch/arm/mach-prima2/
 +F:    drivers/clk/clk-prima2.c
 +F:    drivers/clocksource/timer-prima2.c
 +F:    drivers/clocksource/timer-marco.c
  F:    drivers/dma/sirf-dma.c
  F:    drivers/i2c/busses/i2c-sirf.c
 +F:    drivers/input/misc/sirfsoc-onkey.c
 +F:    drivers/irqchip/irq-sirfsoc.c
  F:    drivers/mmc/host/sdhci-sirf.c
  F:    drivers/pinctrl/sirf/
 +F:    drivers/rtc/rtc-sirfsoc.c
  F:    drivers/spi/spi-sirf.c
  
  ARM/EBSA110 MACHINE SUPPORT
@@@ -1416,7 -1396,7 +1416,7 @@@ M:      Wolfram Sang <wsa@the-dreams.de
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
  F:    drivers/misc/eeprom/at24.c
 -F:    include/linux/i2c/at24.h
 +F:    include/linux/platform_data/at24.h
  
  ATA OVER ETHERNET (AOE) DRIVER
  M:    "Ed L. Cashin" <ecashin@coraid.com>
@@@ -1672,9 -1652,9 +1672,9 @@@ F:      drivers/video/backlight
  F:    include/linux/backlight.h
  
  BATMAN ADVANCED
 -M:    Marek Lindner <lindner_marek@yahoo.de>
 -M:    Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
 -M:    Antonio Quartulli <ordex@autistici.org>
 +M:    Marek Lindner <mareklindner@neomailbox.ch>
 +M:    Simon Wunderlich <sw@simonwunderlich.de>
 +M:    Antonio Quartulli <antonio@meshcoding.com>
  L:    b.a.t.m.a.n@lists.open-mesh.org
  W:    http://www.open-mesh.org/
  S:    Maintained
@@@ -1805,7 -1785,6 +1805,7 @@@ F:      include/net/bluetooth
  
  BONDING DRIVER
  M:    Jay Vosburgh <fubar@us.ibm.com>
 +M:    Veaceslav Falico <vfalico@redhat.com>
  M:    Andy Gospodarek <andy@greyhouse.net>
  L:    netdev@vger.kernel.org
  W:    http://sourceforge.net/projects/bonding/
@@@ -1833,8 -1812,7 +1833,8 @@@ S:      Supporte
  F:    drivers/net/ethernet/broadcom/bnx2x/
  
  BROADCOM BCM281XX/BCM11XXX ARM ARCHITECTURE
 -M:    Christian Daudt <csd@broadcom.com>
 +M:    Christian Daudt <bcm@fixthebug.org>
 +L:    bcm-kernel-feedback-list@broadcom.com
  T:    git git://git.github.com/broadcom/bcm11351
  S:    Maintained
  F:    arch/arm/mach-bcm/
@@@ -2315,7 -2293,7 +2315,7 @@@ S:      Maintaine
  F:    drivers/net/ethernet/ti/cpmac.c
  
  CPU FREQUENCY DRIVERS
 -M:    Rafael J. Wysocki <rjw@sisk.pl>
 +M:    Rafael J. Wysocki <rjw@rjwysocki.net>
  M:    Viresh Kumar <viresh.kumar@linaro.org>
  L:    cpufreq@vger.kernel.org
  L:    linux-pm@vger.kernel.org
@@@ -2346,7 -2324,7 +2346,7 @@@ S:      Maintaine
  F:      drivers/cpuidle/cpuidle-big_little.c
  
  CPUIDLE DRIVERS
 -M:    Rafael J. Wysocki <rjw@sisk.pl>
 +M:    Rafael J. Wysocki <rjw@rjwysocki.net>
  M:    Daniel Lezcano <daniel.lezcano@linaro.org>
  L:    linux-pm@vger.kernel.org
  S:    Maintained
@@@ -2661,18 -2639,6 +2661,18 @@@ F:    include/linux/device-mapper.
  F:    include/linux/dm-*.h
  F:    include/uapi/linux/dm-*.h
  
 +DIGI NEO AND CLASSIC PCI PRODUCTS
 +M:    Lidza Louina <lidza.louina@gmail.com>
 +L:    driverdev-devel@linuxdriverproject.org
 +S:    Maintained
 +F:    drivers/staging/dgnc/
 +
 +DIGI EPCA PCI PRODUCTS
 +M:    Lidza Louina <lidza.louina@gmail.com>
 +L:    driverdev-devel@linuxdriverproject.org
 +S:    Maintained
 +F:    drivers/staging/dgap/
 +
  DIOLAN U2C-12 I2C DRIVER
  M:    Guenter Roeck <linux@roeck-us.net>
  L:    linux-i2c@vger.kernel.org
@@@ -2733,8 -2699,6 +2733,8 @@@ T:      git git://git.linaro.org/people/sumi
  DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
  M:    Vinod Koul <vinod.koul@intel.com>
  M:    Dan Williams <dan.j.williams@intel.com>
 +L:    dmaengine@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-dmaengine/list/
  S:    Supported
  F:    drivers/dma/
  F:    include/linux/dma*
@@@ -2839,9 -2803,7 +2839,9 @@@ L:      dri-devel@lists.freedesktop.or
  L:    linux-tegra@vger.kernel.org
  T:    git git://anongit.freedesktop.org/tegra/linux.git
  S:    Maintained
 +F:    drivers/gpu/drm/tegra/
  F:    drivers/gpu/host1x/
 +F:    include/linux/host1x.h
  F:    include/uapi/drm/tegra_drm.h
  F:    Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
  
@@@ -3572,7 -3534,7 +3572,7 @@@ F:      fs/freevxfs
  
  FREEZER
  M:    Pavel Machek <pavel@ucw.cz>
 -M:    "Rafael J. Wysocki" <rjw@sisk.pl>
 +M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    Documentation/power/freezing-of-tasks.txt
@@@ -3643,12 -3605,6 +3643,12 @@@ L:    linux-scsi@vger.kernel.or
  S:    Odd Fixes (e.g., new signatures)
  F:    drivers/scsi/fdomain.*
  
 +GCOV BASED KERNEL PROFILING
 +M:    Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
 +S:    Maintained
 +F:    kernel/gcov/
 +F:    Documentation/gcov.txt
 +
  GDT SCSI DISK ARRAY CONTROLLER DRIVER
  M:    Achim Leubner <achim_leubner@adaptec.com>
  L:    linux-scsi@vger.kernel.org
@@@ -3914,7 -3870,7 +3914,7 @@@ F:      drivers/video/hgafb.
  
  HIBERNATION (aka Software Suspend, aka swsusp)
  M:    Pavel Machek <pavel@ucw.cz>
 -M:    "Rafael J. Wysocki" <rjw@sisk.pl>
 +M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    arch/x86/power/
@@@ -4364,7 -4320,7 +4364,7 @@@ F:      drivers/video/i810
  INTEL MENLOW THERMAL DRIVER
  M:    Sujith Thomas <sujith.thomas@intel.com>
  L:    platform-driver-x86@vger.kernel.org
 -W:    http://www.lesswatts.org/projects/acpi/
 +W:    https://01.org/linux-acpi
  S:    Supported
  F:    drivers/platform/x86/intel_menlow.c
  
@@@ -4376,10 -4332,7 +4376,10 @@@ F:    arch/x86/kernel/microcode_intel.
  
  INTEL I/OAT DMA DRIVER
  M:    Dan Williams <dan.j.williams@intel.com>
 -S:    Maintained
 +M:    Dave Jiang <dave.jiang@intel.com>
 +L:    dmaengine@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-dmaengine/list/
 +S:    Supported
  F:    drivers/dma/ioat*
  
  INTEL IOMMU (VT-d)
@@@ -4504,13 -4457,6 +4504,13 @@@ L:    linux-serial@vger.kernel.or
  S:    Maintained
  F:    drivers/tty/serial/ioc3_serial.c
  
 +IOMMU DRIVERS
 +M:    Joerg Roedel <joro@8bytes.org>
 +L:    iommu@lists.linux-foundation.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 +S:    Maintained
 +F:    drivers/iommu/
 +
  IP MASQUERADING
  M:    Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
  S:    Maintained
@@@ -6400,12 -6346,6 +6400,12 @@@ S:    Supporte
  F:    Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
  F:    drivers/pci/host/pci-tegra.c
  
 +PCI DRIVER FOR SAMSUNG EXYNOS
 +M:    Jingoo Han <jg1.han@samsung.com>
 +L:    linux-pci@vger.kernel.org
 +S:    Maintained
 +F:    drivers/pci/host/pci-exynos.c
 +
  PCMCIA SUBSYSTEM
  P:    Linux PCMCIA Team
  L:    linux-pcmcia@lists.infradead.org
@@@ -6655,7 -6595,7 +6655,7 @@@ S:      Obsolet
  F:    drivers/net/wireless/prism54/
  
  PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER
 -M:    Mikael Pettersson <mikpe@it.uu.se>
 +M:    Mikael Pettersson <mikpelinux@gmail.com>
  L:    linux-ide@vger.kernel.org
  S:    Maintained
  F:    drivers/ata/sata_promise.*
@@@ -6876,14 -6816,6 +6876,14 @@@ L:    linux-hexagon@vger.kernel.or
  S:    Supported
  F:    arch/hexagon/
  
 +QUALCOMM WCN36XX WIRELESS DRIVER
 +M:    Eugene Krasnikov <k.eugene.e@gmail.com>
 +L:    wcn36xx@lists.infradead.org
 +W:    http://wireless.kernel.org/en/users/Drivers/wcn36xx
 +T:    git git://github.com/KrasnikovEugene/wcn36xx.git
 +S:    Supported
 +F:    drivers/net/wireless/ath/wcn36xx/
 +
  QUICKCAM PARALLEL PORT WEBCAMS
  M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
@@@ -7326,9 -7258,9 +7326,9 @@@ F:      include/linux/sched.
  F:    include/uapi/linux/sched.h
  
  SCORE ARCHITECTURE
 -M:    Chen Liqin <liqin.chen@sunplusct.com>
 +M:    Chen Liqin <liqin.linux@gmail.com>
  M:    Lennox Wu <lennox.wu@gmail.com>
 -W:    http://www.sunplusct.com
 +W:    http://www.sunplus.com
  S:    Supported
  F:    arch/score/
  
@@@ -7458,9 -7390,10 +7458,10 @@@ SELINUX SECURITY MODUL
  M:    Stephen Smalley <sds@tycho.nsa.gov>
  M:    James Morris <james.l.morris@oracle.com>
  M:    Eric Paris <eparis@parisplace.org>
+ M:    Paul Moore <paul@paul-moore.com>
  L:    selinux@tycho.nsa.gov (subscribers-only, general discussion)
  W:    http://selinuxproject.org
- T:    git git://git.infradead.org/users/eparis/selinux.git
+ T:    git git://git.infradead.org/users/pcmoore/selinux
  S:    Supported
  F:    include/linux/selinux*
  F:    security/selinux/
@@@ -7858,13 -7791,6 +7859,13 @@@ F:    Documentation/sound/alsa/soc
  F:    sound/soc/
  F:    include/sound/soc*
  
 +SOUND - DMAENGINE HELPERS
 +M:    Lars-Peter Clausen <lars@metafoo.de>
 +S:    Supported
 +F:    include/sound/dmaengine_pcm.h
 +F:    sound/core/pcm_dmaengine.c
 +F:    sound/soc/soc-generic-dmaengine-pcm.c
 +
  SPARC + UltraSPARC (sparc/sparc64)
  M:    "David S. Miller" <davem@davemloft.net>
  L:    sparclinux@vger.kernel.org
@@@ -8144,7 -8070,7 +8145,7 @@@ F:      drivers/sh
  SUSPEND TO RAM
  M:    Len Brown <len.brown@intel.com>
  M:    Pavel Machek <pavel@ucw.cz>
 -M:    "Rafael J. Wysocki" <rjw@sisk.pl>
 +M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
  L:    linux-pm@vger.kernel.org
  S:    Supported
  F:    Documentation/power/
@@@ -8549,6 -8475,7 +8550,7 @@@ F:      drivers/media/usb/tm6000
  TPM DEVICE DRIVER
  M:    Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
  M:    Ashley Lai <ashley@ashleylai.com>
+ M:    Peter Huewe <peterhuewe@gmx.de>
  M:    Rajiv Andrade <mail@srajiv.net>
  W:    http://tpmdd.sourceforge.net
  M:    Marcel Selhorst <tpmdd@selhorst.net>
@@@ -8645,6 -8572,14 +8647,6 @@@ S:     Maintaine
  F:    arch/m68k/*/*_no.*
  F:    arch/m68k/include/asm/*_no.*
  
 -UCLINUX FOR RENESAS H8/300 (H8300)
 -M:    Yoshinori Sato <ysato@users.sourceforge.jp>
 -W:    http://uclinux-h8.sourceforge.jp/
 -S:    Supported
 -F:    arch/h8300/
 -F:    drivers/ide/ide-h8300.c
 -F:    drivers/net/ethernet/8390/ne-h8300.c
 -
  UDF FILESYSTEM
  M:    Jan Kara <jack@suse.cz>
  S:    Maintained
@@@ -8791,8 -8726,9 +8793,8 @@@ F:      Documentation/hid/hiddev.tx
  F:    drivers/hid/usbhid/
  
  USB/IP DRIVERS
 -M:    Matt Mooney <mfm@muteddisk.com>
  L:    linux-usb@vger.kernel.org
 -S:    Maintained
 +S:    Orphan
  F:    drivers/staging/usbip/
  
  USB ISP116X DRIVER
@@@ -9432,7 -9368,6 +9434,7 @@@ F:      arch/arm64/include/asm/xen
  
  XEN NETWORK BACKEND DRIVER
  M:    Ian Campbell <ian.campbell@citrix.com>
 +M:    Wei Liu <wei.liu2@citrix.com>
  L:    xen-devel@lists.xenproject.org (moderated for non-subscribers)
  L:    netdev@vger.kernel.org
  S:    Supported
index 94c280d36e8b3bfaea00ee36c4fe3215818b3c86,9b483705694e9a70e60af545b43b70738bb59ce3..c8ff4df81779f3b66a3e62abab055b4e404b81e7
@@@ -10,7 -10,6 +10,7 @@@
  #include <linux/errno.h>
  #include <linux/err.h>
  #include <linux/interrupt.h>
 +#include <xen/xen.h>
  #include <xen/events.h>
  #include <xen/interface/io/tpmif.h>
  #include <xen/grant_table.h>
@@@ -143,6 -142,32 +143,6 @@@ static int vtpm_recv(struct tpm_chip *c
        return length;
  }
  
 -ssize_t tpm_show_locality(struct device *dev, struct device_attribute *attr,
 -                        char *buf)
 -{
 -      struct tpm_chip *chip = dev_get_drvdata(dev);
 -      struct tpm_private *priv = TPM_VPRIV(chip);
 -      u8 locality = priv->shr->locality;
 -
 -      return sprintf(buf, "%d\n", locality);
 -}
 -
 -ssize_t tpm_store_locality(struct device *dev, struct device_attribute *attr,
 -                      const char *buf, size_t len)
 -{
 -      struct tpm_chip *chip = dev_get_drvdata(dev);
 -      struct tpm_private *priv = TPM_VPRIV(chip);
 -      u8 val;
 -
 -      int rv = kstrtou8(buf, 0, &val);
 -      if (rv)
 -              return rv;
 -
 -      priv->shr->locality = val;
 -
 -      return len;
 -}
 -
  static const struct file_operations vtpm_ops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
@@@ -163,6 -188,8 +163,6 @@@ static DEVICE_ATTR(caps, S_IRUGO, tpm_s
  static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);
  static DEVICE_ATTR(durations, S_IRUGO, tpm_show_durations, NULL);
  static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL);
 -static DEVICE_ATTR(locality, S_IRUGO | S_IWUSR, tpm_show_locality,
 -              tpm_store_locality);
  
  static struct attribute *vtpm_attrs[] = {
        &dev_attr_pubek.attr,
        &dev_attr_cancel.attr,
        &dev_attr_durations.attr,
        &dev_attr_timeouts.attr,
 -      &dev_attr_locality.attr,
        NULL,
  };
  
@@@ -182,6 -210,8 +182,6 @@@ static struct attribute_group vtpm_attr
        .attrs = vtpm_attrs,
  };
  
 -#define TPM_LONG_TIMEOUT   (10 * 60 * HZ)
 -
  static const struct tpm_vendor_specific tpm_vtpm = {
        .status = vtpm_status,
        .recv = vtpm_recv,
        .miscdev = {
                .fops = &vtpm_ops,
        },
 -      .duration = {
 -              TPM_LONG_TIMEOUT,
 -              TPM_LONG_TIMEOUT,
 -              TPM_LONG_TIMEOUT,
 -      },
  };
  
  static irqreturn_t tpmif_interrupt(int dummy, void *dev_id)
@@@ -351,8 -386,6 +351,6 @@@ static int tpmfront_probe(struct xenbus
  
        tpm_get_timeouts(priv->chip);
  
-       dev_set_drvdata(&dev->dev, priv->chip);
        return rv;
  }
  
diff --combined init/Kconfig
index d9887456007a83b212eb41dabf95f7d8c781c6b4,0ff5407a8378ce3007de777f49003420ae4cd193..73766535ded5bc0a230248db7f7552bb8df7c53d
@@@ -284,7 -284,7 +284,7 @@@ config AUDI
  
  config AUDITSYSCALL
        bool "Enable system-call auditing support"
 -      depends on AUDIT && (X86 || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT))
 +      depends on AUDIT && (X86 || PARISC || PPC || S390 || IA64 || UML || SPARC64 || SUPERH || (ARM && AEABI && !OABI_COMPAT))
        default y if SECURITY_SELINUX
        help
          Enable low-overhead system-call auditing infrastructure that
@@@ -1668,6 -1668,18 +1668,18 @@@ config BASE_SMAL
        default 0 if BASE_FULL
        default 1 if !BASE_FULL
  
+ config SYSTEM_TRUSTED_KEYRING
+       bool "Provide system-wide ring of trusted keys"
+       depends on KEYS
+       help
+         Provide a system keyring to which trusted keys can be added.  Keys in
+         the keyring are considered to be trusted.  Keys may be added at will
+         by the kernel from compiled-in data and from hardware key stores, but
+         userspace may only add extra keys if those keys can be verified by
+         keys already in the keyring.
+         Keys in this keyring are used by module signature checking.
  menuconfig MODULES
        bool "Enable loadable module support"
        option modules
@@@ -1741,6 -1753,7 +1753,7 @@@ config MODULE_SRCVERSION_AL
  config MODULE_SIG
        bool "Module signature verification"
        depends on MODULES
+       select SYSTEM_TRUSTED_KEYRING
        select KEYS
        select CRYPTO
        select ASYMMETRIC_KEY_TYPE
diff --combined security/selinux/hooks.c
index c540795fb3f2647619cb4705281872e93592e21e,6d0bf5c0c8323a4f0f56f1879fce1a6c4c53e8fa..794c3ca49eac92998caa17be71a4bdc472c2e9c8
@@@ -95,7 -95,9 +95,9 @@@
  #include "audit.h"
  #include "avc_ss.h"
  
- #define NUM_SEL_MNT_OPTS 5
+ #define SB_TYPE_FMT "%s%s%s"
+ #define SB_SUBTYPE(sb) (sb->s_subtype && sb->s_subtype[0])
+ #define SB_TYPE_ARGS(sb) sb->s_type->name, SB_SUBTYPE(sb) ? "." : "", SB_SUBTYPE(sb) ? sb->s_subtype : ""
  
  extern struct security_operations *security_ops;
  
@@@ -139,12 -141,28 +141,28 @@@ static struct kmem_cache *sel_inode_cac
   * This function checks the SECMARK reference counter to see if any SECMARK
   * targets are currently configured, if the reference counter is greater than
   * zero SECMARK is considered to be enabled.  Returns true (1) if SECMARK is
-  * enabled, false (0) if SECMARK is disabled.
+  * enabled, false (0) if SECMARK is disabled.  If the always_check_network
+  * policy capability is enabled, SECMARK is always considered enabled.
   *
   */
  static int selinux_secmark_enabled(void)
  {
-       return (atomic_read(&selinux_secmark_refcount) > 0);
+       return (selinux_policycap_alwaysnetwork || atomic_read(&selinux_secmark_refcount));
+ }
+ /**
+  * selinux_peerlbl_enabled - Check to see if peer labeling is currently enabled
+  *
+  * Description:
+  * This function checks if NetLabel or labeled IPSEC is enabled.  Returns true
+  * (1) if any are enabled or false (0) if neither are enabled.  If the
+  * always_check_network policy capability is enabled, peer labeling
+  * is always considered enabled.
+  *
+  */
+ static int selinux_peerlbl_enabled(void)
+ {
+       return (selinux_policycap_alwaysnetwork || netlbl_enabled() || selinux_xfrm_enabled());
  }
  
  /*
@@@ -309,8 -327,11 +327,11 @@@ enum 
        Opt_defcontext = 3,
        Opt_rootcontext = 4,
        Opt_labelsupport = 5,
+       Opt_nextmntopt = 6,
  };
  
+ #define NUM_SEL_MNT_OPTS      (Opt_nextmntopt - 1)
  static const match_table_t tokens = {
        {Opt_context, CONTEXT_STR "%s"},
        {Opt_fscontext, FSCONTEXT_STR "%s"},
@@@ -355,6 -376,29 +376,29 @@@ static int may_context_mount_inode_rela
        return rc;
  }
  
+ static int selinux_is_sblabel_mnt(struct super_block *sb)
+ {
+       struct superblock_security_struct *sbsec = sb->s_security;
+       if (sbsec->behavior == SECURITY_FS_USE_XATTR ||
+           sbsec->behavior == SECURITY_FS_USE_TRANS ||
+           sbsec->behavior == SECURITY_FS_USE_TASK)
+               return 1;
+       /* Special handling for sysfs. Is genfs but also has setxattr handler*/
+       if (strncmp(sb->s_type->name, "sysfs", sizeof("sysfs")) == 0)
+               return 1;
+       /*
+        * Special handling for rootfs. Is genfs but supports
+        * setting SELinux context on in-core inodes.
+        */
+       if (strncmp(sb->s_type->name, "rootfs", sizeof("rootfs")) == 0)
+               return 1;
+       return 0;
+ }
  static int sb_finish_set_opts(struct super_block *sb)
  {
        struct superblock_security_struct *sbsec = sb->s_security;
                   the first boot of the SELinux kernel before we have
                   assigned xattr values to the filesystem. */
                if (!root_inode->i_op->getxattr) {
-                       printk(KERN_WARNING "SELinux: (dev %s, type %s) has no "
-                              "xattr support\n", sb->s_id, sb->s_type->name);
+                       printk(KERN_WARNING "SELinux: (dev %s, type "SB_TYPE_FMT") has no "
+                              "xattr support\n", sb->s_id, SB_TYPE_ARGS(sb));
                        rc = -EOPNOTSUPP;
                        goto out;
                }
                if (rc < 0 && rc != -ENODATA) {
                        if (rc == -EOPNOTSUPP)
                                printk(KERN_WARNING "SELinux: (dev %s, type "
-                                      "%s) has no security xattr handler\n",
-                                      sb->s_id, sb->s_type->name);
+                                      SB_TYPE_FMT") has no security xattr handler\n",
+                                      sb->s_id, SB_TYPE_ARGS(sb));
                        else
                                printk(KERN_WARNING "SELinux: (dev %s, type "
-                                      "%s) getxattr errno %d\n", sb->s_id,
-                                      sb->s_type->name, -rc);
+                                      SB_TYPE_FMT") getxattr errno %d\n", sb->s_id,
+                                      SB_TYPE_ARGS(sb), -rc);
                        goto out;
                }
        }
  
-       sbsec->flags |= (SE_SBINITIALIZED | SE_SBLABELSUPP);
        if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
-               printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
-                      sb->s_id, sb->s_type->name);
+               printk(KERN_ERR "SELinux: initialized (dev %s, type "SB_TYPE_FMT"), unknown behavior\n",
+                      sb->s_id, SB_TYPE_ARGS(sb));
        else
-               printk(KERN_DEBUG "SELinux: initialized (dev %s, type %s), %s\n",
-                      sb->s_id, sb->s_type->name,
+               printk(KERN_DEBUG "SELinux: initialized (dev %s, type "SB_TYPE_FMT"), %s\n",
+                      sb->s_id, SB_TYPE_ARGS(sb),
                       labeling_behaviors[sbsec->behavior-1]);
  
-       if (sbsec->behavior == SECURITY_FS_USE_GENFS ||
-           sbsec->behavior == SECURITY_FS_USE_MNTPOINT ||
-           sbsec->behavior == SECURITY_FS_USE_NONE ||
-           sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
-               sbsec->flags &= ~SE_SBLABELSUPP;
-       /* Special handling for sysfs. Is genfs but also has setxattr handler*/
-       if (strncmp(sb->s_type->name, "sysfs", sizeof("sysfs")) == 0)
-               sbsec->flags |= SE_SBLABELSUPP;
+       sbsec->flags |= SE_SBINITIALIZED;
+       if (selinux_is_sblabel_mnt(sb))
+               sbsec->flags |= SBLABEL_MNT;
  
        /* Initialize the root inode. */
        rc = inode_doinit_with_dentry(root_inode, root);
@@@ -460,15 -496,18 +496,18 @@@ static int selinux_get_mnt_opts(const s
        if (!ss_initialized)
                return -EINVAL;
  
+       /* make sure we always check enough bits to cover the mask */
+       BUILD_BUG_ON(SE_MNTMASK >= (1 << NUM_SEL_MNT_OPTS));
        tmp = sbsec->flags & SE_MNTMASK;
        /* count the number of mount options for this sb */
-       for (i = 0; i < 8; i++) {
+       for (i = 0; i < NUM_SEL_MNT_OPTS; i++) {
                if (tmp & 0x01)
                        opts->num_mnt_opts++;
                tmp >>= 1;
        }
        /* Check if the Label support flag is set */
-       if (sbsec->flags & SE_SBLABELSUPP)
+       if (sbsec->flags & SBLABEL_MNT)
                opts->num_mnt_opts++;
  
        opts->mnt_opts = kcalloc(opts->num_mnt_opts, sizeof(char *), GFP_ATOMIC);
                opts->mnt_opts[i] = context;
                opts->mnt_opts_flags[i++] = ROOTCONTEXT_MNT;
        }
-       if (sbsec->flags & SE_SBLABELSUPP) {
+       if (sbsec->flags & SBLABEL_MNT) {
                opts->mnt_opts[i] = NULL;
-               opts->mnt_opts_flags[i++] = SE_SBLABELSUPP;
+               opts->mnt_opts_flags[i++] = SBLABEL_MNT;
        }
  
        BUG_ON(i != opts->num_mnt_opts);
@@@ -561,7 -600,6 +600,6 @@@ static int selinux_set_mnt_opts(struct 
        const struct cred *cred = current_cred();
        int rc = 0, i;
        struct superblock_security_struct *sbsec = sb->s_security;
-       const char *name = sb->s_type->name;
        struct inode *inode = sbsec->sb->s_root->d_inode;
        struct inode_security_struct *root_isec = inode->i_security;
        u32 fscontext_sid = 0, context_sid = 0, rootcontext_sid = 0;
        for (i = 0; i < num_opts; i++) {
                u32 sid;
  
-               if (flags[i] == SE_SBLABELSUPP)
+               if (flags[i] == SBLABEL_MNT)
                        continue;
                rc = security_context_to_sid(mount_options[i],
                                             strlen(mount_options[i]), &sid);
                if (rc) {
                        printk(KERN_WARNING "SELinux: security_context_to_sid"
-                              "(%s) failed for (dev %s, type %s) errno=%d\n",
-                              mount_options[i], sb->s_id, name, rc);
+                              "(%s) failed for (dev %s, type "SB_TYPE_FMT") errno=%d\n",
+                              mount_options[i], sb->s_id, SB_TYPE_ARGS(sb), rc);
                        goto out;
                }
                switch (flags[i]) {
                 * Determine the labeling behavior to use for this
                 * filesystem type.
                 */
-               rc = security_fs_use((sbsec->flags & SE_SBPROC) ?
-                                       "proc" : sb->s_type->name,
-                                       &sbsec->behavior, &sbsec->sid);
+               rc = security_fs_use(sb);
                if (rc) {
                        printk(KERN_WARNING
                                "%s: security_fs_use(%s) returned %d\n",
@@@ -770,7 -806,8 +806,8 @@@ out
  out_double_mount:
        rc = -EINVAL;
        printk(KERN_WARNING "SELinux: mount invalid.  Same superblock, different "
-              "security settings for (dev %s, type %s)\n", sb->s_id, name);
+              "security settings for (dev %s, type "SB_TYPE_FMT")\n", sb->s_id,
+              SB_TYPE_ARGS(sb));
        goto out;
  }
  
@@@ -1037,7 -1074,7 +1074,7 @@@ static void selinux_write_opts(struct s
                case DEFCONTEXT_MNT:
                        prefix = DEFCONTEXT_STR;
                        break;
-               case SE_SBLABELSUPP:
+               case SBLABEL_MNT:
                        seq_putc(m, ',');
                        seq_puts(m, LABELSUPP_STR);
                        continue;
@@@ -1502,7 -1539,7 +1539,7 @@@ static int cred_has_capability(const st
  
        rc = avc_has_perm_noaudit(sid, sid, sclass, av, 0, &avd);
        if (audit == SECURITY_CAP_AUDIT) {
 -              int rc2 = avc_audit(sid, sid, sclass, av, &avd, rc, &ad, 0);
 +              int rc2 = avc_audit(sid, sid, sclass, av, &avd, rc, &ad);
                if (rc2)
                        return rc2;
        }
@@@ -1525,7 -1562,8 +1562,7 @@@ static int task_has_system(struct task_
  static int inode_has_perm(const struct cred *cred,
                          struct inode *inode,
                          u32 perms,
 -                        struct common_audit_data *adp,
 -                        unsigned flags)
 +                        struct common_audit_data *adp)
  {
        struct inode_security_struct *isec;
        u32 sid;
        sid = cred_sid(cred);
        isec = inode->i_security;
  
 -      return avc_has_perm_flags(sid, isec->sid, isec->sclass, perms, adp, flags);
 +      return avc_has_perm(sid, isec->sid, isec->sclass, perms, adp);
  }
  
  /* Same as inode_has_perm, but pass explicit audit data containing
@@@ -1553,7 -1591,7 +1590,7 @@@ static inline int dentry_has_perm(cons
  
        ad.type = LSM_AUDIT_DATA_DENTRY;
        ad.u.dentry = dentry;
 -      return inode_has_perm(cred, inode, av, &ad, 0);
 +      return inode_has_perm(cred, inode, av, &ad);
  }
  
  /* Same as inode_has_perm, but pass explicit audit data containing
@@@ -1568,7 -1606,7 +1605,7 @@@ static inline int path_has_perm(const s
  
        ad.type = LSM_AUDIT_DATA_PATH;
        ad.u.path = *path;
 -      return inode_has_perm(cred, inode, av, &ad, 0);
 +      return inode_has_perm(cred, inode, av, &ad);
  }
  
  /* Same as path_has_perm, but uses the inode from the file struct. */
@@@ -1580,7 -1618,7 +1617,7 @@@ static inline int file_path_has_perm(co
  
        ad.type = LSM_AUDIT_DATA_PATH;
        ad.u.path = file->f_path;
 -      return inode_has_perm(cred, file_inode(file), av, &ad, 0);
 +      return inode_has_perm(cred, file_inode(file), av, &ad);
  }
  
  /* Check whether a task can use an open file descriptor to
@@@ -1616,7 -1654,7 +1653,7 @@@ static int file_has_perm(const struct c
        /* av is zero if only checking access to the descriptor. */
        rc = 0;
        if (av)
 -              rc = inode_has_perm(cred, inode, av, &ad, 0);
 +              rc = inode_has_perm(cred, inode, av, &ad);
  
  out:
        return rc;
@@@ -1649,7 -1687,7 +1686,7 @@@ static int may_create(struct inode *dir
        if (rc)
                return rc;
  
-       if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
+       if (!newsid || !(sbsec->flags & SBLABEL_MNT)) {
                rc = security_transition_sid(sid, dsec->sid, tclass,
                                             &dentry->d_name, &newsid);
                if (rc)
@@@ -2437,14 -2475,14 +2474,14 @@@ static int selinux_sb_remount(struct su
                u32 sid;
                size_t len;
  
-               if (flags[i] == SE_SBLABELSUPP)
+               if (flags[i] == SBLABEL_MNT)
                        continue;
                len = strlen(mount_options[i]);
                rc = security_context_to_sid(mount_options[i], len, &sid);
                if (rc) {
                        printk(KERN_WARNING "SELinux: security_context_to_sid"
-                              "(%s) failed for (dev %s, type %s) errno=%d\n",
-                              mount_options[i], sb->s_id, sb->s_type->name, rc);
+                              "(%s) failed for (dev %s, type "SB_TYPE_FMT") errno=%d\n",
+                              mount_options[i], sb->s_id, SB_TYPE_ARGS(sb), rc);
                        goto out_free_opts;
                }
                rc = -EINVAL;
@@@ -2482,8 -2520,8 +2519,8 @@@ out_free_secdata
        return rc;
  out_bad_option:
        printk(KERN_WARNING "SELinux: unable to change security options "
-              "during remount (dev %s, type=%s)\n", sb->s_id,
-              sb->s_type->name);
+              "during remount (dev %s, type "SB_TYPE_FMT")\n", sb->s_id,
+              SB_TYPE_ARGS(sb));
        goto out_free_opts;
  }
  
@@@ -2606,7 -2644,7 +2643,7 @@@ static int selinux_inode_init_security(
        if ((sbsec->flags & SE_SBINITIALIZED) &&
            (sbsec->behavior == SECURITY_FS_USE_MNTPOINT))
                newsid = sbsec->mntpoint_sid;
-       else if (!newsid || !(sbsec->flags & SE_SBLABELSUPP)) {
+       else if (!newsid || !(sbsec->flags & SBLABEL_MNT)) {
                rc = security_transition_sid(sid, dsec->sid,
                                             inode_mode_to_security_class(inode->i_mode),
                                             qstr, &newsid);
                isec->initialized = 1;
        }
  
-       if (!ss_initialized || !(sbsec->flags & SE_SBLABELSUPP))
+       if (!ss_initialized || !(sbsec->flags & SBLABEL_MNT))
                return -EOPNOTSUPP;
  
        if (name)
@@@ -2830,7 -2868,7 +2867,7 @@@ static int selinux_inode_setxattr(struc
                return selinux_inode_setotherxattr(dentry, name);
  
        sbsec = inode->i_sb->s_security;
-       if (!(sbsec->flags & SE_SBLABELSUPP))
+       if (!(sbsec->flags & SBLABEL_MNT))
                return -EOPNOTSUPP;
  
        if (!inode_owner_or_capable(inode))
@@@ -3791,8 -3829,12 +3828,12 @@@ static int selinux_skb_peerlbl_sid(stru
        u32 nlbl_sid;
        u32 nlbl_type;
  
-       selinux_skb_xfrm_sid(skb, &xfrm_sid);
-       selinux_netlbl_skbuff_getsid(skb, family, &nlbl_type, &nlbl_sid);
+       err = selinux_skb_xfrm_sid(skb, &xfrm_sid);
+       if (unlikely(err))
+               return -EACCES;
+       err = selinux_netlbl_skbuff_getsid(skb, family, &nlbl_type, &nlbl_sid);
+       if (unlikely(err))
+               return -EACCES;
  
        err = security_net_peersid_resolve(nlbl_sid, nlbl_type, xfrm_sid, sid);
        if (unlikely(err)) {
@@@ -3928,7 -3970,7 +3969,7 @@@ static int selinux_socket_bind(struct s
                if (snum) {
                        int low, high;
  
 -                      inet_get_local_port_range(&low, &high);
 +                      inet_get_local_port_range(sock_net(sk), &low, &high);
  
                        if (snum < max(PROT_SOCK, low) || snum > high) {
                                err = sel_netport_sid(sk->sk_protocol,
@@@ -4246,7 -4288,7 +4287,7 @@@ static int selinux_socket_sock_rcv_skb(
                return selinux_sock_rcv_skb_compat(sk, skb, family);
  
        secmark_active = selinux_secmark_enabled();
-       peerlbl_active = netlbl_enabled() || selinux_xfrm_enabled();
+       peerlbl_active = selinux_peerlbl_enabled();
        if (!secmark_active && !peerlbl_active)
                return 0;
  
@@@ -4628,7 -4670,7 +4669,7 @@@ static unsigned int selinux_ip_forward(
  
        secmark_active = selinux_secmark_enabled();
        netlbl_active = netlbl_enabled();
-       peerlbl_active = netlbl_active || selinux_xfrm_enabled();
+       peerlbl_active = selinux_peerlbl_enabled();
        if (!secmark_active && !peerlbl_active)
                return NF_ACCEPT;
  
        return NF_ACCEPT;
  }
  
 -static unsigned int selinux_ipv4_forward(unsigned int hooknum,
 +static unsigned int selinux_ipv4_forward(const struct nf_hook_ops *ops,
                                         struct sk_buff *skb,
                                         const struct net_device *in,
                                         const struct net_device *out,
  }
  
  #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 -static unsigned int selinux_ipv6_forward(unsigned int hooknum,
 +static unsigned int selinux_ipv6_forward(const struct nf_hook_ops *ops,
                                         struct sk_buff *skb,
                                         const struct net_device *in,
                                         const struct net_device *out,
@@@ -4709,7 -4751,7 +4750,7 @@@ static unsigned int selinux_ip_output(s
        return NF_ACCEPT;
  }
  
 -static unsigned int selinux_ipv4_output(unsigned int hooknum,
 +static unsigned int selinux_ipv4_output(const struct nf_hook_ops *ops,
                                        struct sk_buff *skb,
                                        const struct net_device *in,
                                        const struct net_device *out,
@@@ -4780,7 -4822,7 +4821,7 @@@ static unsigned int selinux_ip_postrout
                return NF_ACCEPT;
  #endif
        secmark_active = selinux_secmark_enabled();
-       peerlbl_active = netlbl_enabled() || selinux_xfrm_enabled();
+       peerlbl_active = selinux_peerlbl_enabled();
        if (!secmark_active && !peerlbl_active)
                return NF_ACCEPT;
  
        return NF_ACCEPT;
  }
  
 -static unsigned int selinux_ipv4_postroute(unsigned int hooknum,
 +static unsigned int selinux_ipv4_postroute(const struct nf_hook_ops *ops,
                                           struct sk_buff *skb,
                                           const struct net_device *in,
                                           const struct net_device *out,
  }
  
  #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
 -static unsigned int selinux_ipv6_postroute(unsigned int hooknum,
 +static unsigned int selinux_ipv6_postroute(const struct nf_hook_ops *ops,
                                           struct sk_buff *skb,
                                           const struct net_device *in,
                                           const struct net_device *out,
@@@ -5784,7 -5826,8 +5825,8 @@@ static struct security_operations selin
        .xfrm_policy_clone_security =   selinux_xfrm_policy_clone,
        .xfrm_policy_free_security =    selinux_xfrm_policy_free,
        .xfrm_policy_delete_security =  selinux_xfrm_policy_delete,
-       .xfrm_state_alloc_security =    selinux_xfrm_state_alloc,
+       .xfrm_state_alloc =             selinux_xfrm_state_alloc,
+       .xfrm_state_alloc_acquire =     selinux_xfrm_state_alloc_acquire,
        .xfrm_state_free_security =     selinux_xfrm_state_free,
        .xfrm_state_delete_security =   selinux_xfrm_state_delete,
        .xfrm_policy_lookup =           selinux_xfrm_policy_lookup,