Merge tag 'selinux-pr-20180814' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Aug 2018 17:39:06 +0000 (10:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Aug 2018 17:39:06 +0000 (10:39 -0700)
Pull SELinux updates from Paul Moore:
 "There are 16 patches in here but really only one that is of any
  significance. That one patch is by nixiaoming and fixes a few places
  where we were not properly cleaning up dentry and inode objects in the
  selinuxfs error handling code. The rest are either printk->pr_*
  conversions, constification tweaks, and a minor tweak to MAINTAINERS.

  Everything passes the selinux-testsuite and looks to merge cleanly
  against your master branch"

* tag 'selinux-pr-20180814' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
  selinux: cleanup dentry and inodes on error in selinuxfs
  selinux: constify write_op[]
  selinux: Cleanup printk logging in netnode
  selinux: Cleanup printk logging in avc
  selinux: Cleanup printk logging in netif
  selinux: Cleanup printk logging in netport
  selinux: Cleanup printk logging in sidtab
  selinux: Cleanup printk logging in netlink
  selinux: Cleanup printk logging in selinuxfs
  selinux: Cleanup printk logging in services
  selinux: Cleanup printk logging in avtab
  selinux: Cleanup printk logging in hooks
  selinux: Cleanup printk logging in policydb
  selinux: Cleanup printk logging in ebitmap
  selinux: Cleanup printk logging in conditional
  MAINTAINERS: update the LSM and SELinux subsystems

1  2 
MAINTAINERS
security/selinux/hooks.c
security/selinux/selinuxfs.c

diff --combined MAINTAINERS
@@@ -367,12 -367,6 +367,12 @@@ L:       linux-acpi@vger.kernel.or
  S:    Maintained
  F:    drivers/acpi/arm64
  
 +ACPI I2C MULTI INSTANTIATE DRIVER
 +M:    Hans de Goede <hdegoede@redhat.com>
 +L:    platform-driver-x86@vger.kernel.org
 +S:    Maintained
 +F:    drivers/platform/x86/i2c-multi-instantiate.c
 +
  ACPI PMIC DRIVERS
  M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
  M:    Len Brown <lenb@kernel.org>
@@@ -587,7 -581,7 +587,7 @@@ W: https://www.infradead.org/~dhowells/
  
  AGPGART DRIVER
  M:    David Airlie <airlied@linux.ie>
 -T:    git git://people.freedesktop.org/~airlied/linux (part of drm maint)
 +T:    git git://anongit.freedesktop.org/drm/drm
  S:    Maintained
  F:    drivers/char/agp/
  F:    include/linux/agp*
@@@ -2270,7 -2264,6 +2270,7 @@@ L:      linux-arm-kernel@lists.infradead.or
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
  S:    Maintained
  F:    arch/arm64/
 +X:    arch/arm64/boot/dts/
  F:    Documentation/arm64/
  
  AS3645A LED FLASH CONTROLLER DRIVER
@@@ -2530,7 -2523,7 +2530,7 @@@ S:      Supporte
  F:    drivers/scsi/esas2r
  
  ATUSB IEEE 802.15.4 RADIO DRIVER
 -M:    Stefan Schmidt <stefan@osg.samsung.com>
 +M:    Stefan Schmidt <stefan@datenfreihafen.org>
  L:    linux-wpan@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ieee802154/atusb.c
@@@ -2978,13 -2971,9 +2978,13 @@@ N:    bcm585
  N:    bcm586*
  N:    bcm88312
  N:    hr2
 -F:    arch/arm64/boot/dts/broadcom/ns2*
 +N:    stingray
 +F:    arch/arm64/boot/dts/broadcom/northstar2/*
 +F:    arch/arm64/boot/dts/broadcom/stingray/*
  F:    drivers/clk/bcm/clk-ns*
 +F:    drivers/clk/bcm/clk-sr*
  F:    drivers/pinctrl/bcm/pinctrl-ns*
 +F:    include/dt-bindings/clock/bcm-sr*
  
  BROADCOM KONA GPIO DRIVER
  M:    Ray Jui <rjui@broadcom.com>
@@@ -4371,7 -4360,12 +4371,7 @@@ L:     iommu@lists.linux-foundation.or
  T:    git git://git.infradead.org/users/hch/dma-mapping.git
  W:    http://git.infradead.org/users/hch/dma-mapping.git
  S:    Supported
 -F:    lib/dma-debug.c
 -F:    lib/dma-direct.c
 -F:    lib/dma-noncoherent.c
 -F:    lib/dma-virt.c
 -F:    drivers/base/dma-mapping.c
 -F:    drivers/base/dma-coherent.c
 +F:    kernel/dma/
  F:    include/asm-generic/dma-mapping.h
  F:    include/linux/dma-direct.h
  F:    include/linux/dma-mapping.h
@@@ -4407,12 -4401,6 +4407,12 @@@ X:    Documentation/sp
  X:    Documentation/media
  T:    git git://git.lwn.net/linux.git docs-next
  
 +DOCUMENTATION/ITALIAN
 +M:    Federico Vaga <federico.vaga@vaga.pv.it>
 +L:    linux-doc@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/translations/it_IT
 +
  DONGWOON DW9714 LENS VOICE COIL DRIVER
  M:    Sakari Ailus <sakari.ailus@linux.intel.com>
  L:    linux-media@vger.kernel.org
@@@ -4473,7 -4461,6 +4473,7 @@@ F:      Documentation/blockdev/drbd
  
  DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +R:    "Rafael J. Wysocki" <rafael@kernel.org>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
  S:    Supported
  F:    Documentation/kobject.txt
@@@ -4644,7 -4631,7 +4644,7 @@@ F:      include/uapi/drm/vmwgfx_drm.
  DRM DRIVERS
  M:    David Airlie <airlied@linux.ie>
  L:    dri-devel@lists.freedesktop.org
 -T:    git git://people.freedesktop.org/~airlied/linux
 +T:    git git://anongit.freedesktop.org/drm/drm
  B:    https://bugs.freedesktop.org/
  C:    irc://chat.freenode.net/dri-devel
  S:    Maintained
@@@ -5457,7 -5444,6 +5457,7 @@@ F:      drivers/iommu/exynos-iommu.
  
  EZchip NPS platform support
  M:    Vineet Gupta <vgupta@synopsys.com>
 +M:    Ofer Levi <oferle@mellanox.com>
  S:    Supported
  F:    arch/arc/plat-eznps
  F:    arch/arc/boot/dts/eznps.dts
@@@ -5688,7 -5674,7 +5688,7 @@@ F:      drivers/crypto/caam
  F:    Documentation/devicetree/bindings/crypto/fsl-sec4.txt
  
  FREESCALE DIU FRAMEBUFFER DRIVER
 -M:    Timur Tabi <timur@tabi.org>
 +M:    Timur Tabi <timur@kernel.org>
  L:    linux-fbdev@vger.kernel.org
  S:    Maintained
  F:    drivers/video/fbdev/fsl-diu-fb.*
@@@ -5788,7 -5774,7 +5788,7 @@@ S:      Maintaine
  F:    drivers/net/wan/fsl_ucc_hdlc*
  
  FREESCALE QUICC ENGINE UCC UART DRIVER
 -M:    Timur Tabi <timur@tabi.org>
 +M:    Timur Tabi <timur@kernel.org>
  L:    linuxppc-dev@lists.ozlabs.org
  S:    Maintained
  F:    drivers/tty/serial/ucc_uart.c
@@@ -5804,6 -5790,7 +5804,6 @@@ F:      include/linux/fsl
  
  FREESCALE SOC FS_ENET DRIVER
  M:    Pantelis Antoniou <pantelis.antoniou@gmail.com>
 -M:    Vitaly Bordug <vbordug@ru.mvista.com>
  L:    linuxppc-dev@lists.ozlabs.org
  L:    netdev@vger.kernel.org
  S:    Maintained
@@@ -5811,7 -5798,7 +5811,7 @@@ F:      drivers/net/ethernet/freescale/fs_en
  F:    include/linux/fs_enet_pd.h
  
  FREESCALE SOC SOUND DRIVERS
 -M:    Timur Tabi <timur@tabi.org>
 +M:    Timur Tabi <timur@kernel.org>
  M:    Nicolin Chen <nicoleotsuka@gmail.com>
  M:    Xiubo Li <Xiubo.Lee@gmail.com>
  R:    Fabio Estevam <fabio.estevam@nxp.com>
@@@ -5943,7 -5930,7 +5943,7 @@@ F:      Documentation/dev-tools/gcov.rs
  
  GDB KERNEL DEBUGGING HELPER SCRIPTS
  M:    Jan Kiszka <jan.kiszka@siemens.com>
 -M:    Kieran Bingham <kieran@bingham.xyz>
 +M:    Kieran Bingham <kbingham@kernel.org>
  S:    Supported
  F:    scripts/gdb/
  
@@@ -6922,7 -6909,7 +6922,7 @@@ F:      drivers/clk/clk-versaclock5.
  
  IEEE 802.15.4 SUBSYSTEM
  M:    Alexander Aring <alex.aring@gmail.com>
 -M:    Stefan Schmidt <stefan@osg.samsung.com>
 +M:    Stefan Schmidt <stefan@datenfreihafen.org>
  L:    linux-wpan@vger.kernel.org
  W:    http://wpan.cakelab.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
@@@ -7041,7 -7028,7 +7041,7 @@@ M:      Guenter Roeck <linux@roeck-us.net
  L:    linux-hwmon@vger.kernel.org
  S:    Maintained
  F:    Documentation/hwmon/ina209
 -F:    Documentation/devicetree/bindings/i2c/ina209.txt
 +F:    Documentation/devicetree/bindings/hwmon/ina2xx.txt
  F:    drivers/hwmon/ina209.c
  
  INA2XX HARDWARE MONITOR DRIVER
@@@ -7109,7 -7096,6 +7109,7 @@@ F:      include/uapi/linux/input.
  F:    include/uapi/linux/input-event-codes.h
  F:    include/linux/input/
  F:    Documentation/devicetree/bindings/input/
 +F:    Documentation/devicetree/bindings/serio/
  F:    Documentation/input/
  
  INPUT MULTITOUCH (MT) PROTOCOL
@@@ -7999,7 -7985,7 +7999,7 @@@ F:      lib/test_kmod.
  F:    tools/testing/selftests/kmod/
  
  KPROBES
 -M:    Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
 +M:    Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
  M:    Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
  M:    "David S. Miller" <davem@davemloft.net>
  M:    Masami Hiramatsu <mhiramat@kernel.org>
@@@ -8330,18 -8316,17 +8330,18 @@@ M:   Jade Alglave <j.alglave@ucl.ac.uk
  M:    Luc Maranget <luc.maranget@inria.fr>
  M:    "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
  R:    Akira Yokosawa <akiyks@gmail.com>
 +R:    Daniel Lustig <dlustig@nvidia.com>
  L:    linux-kernel@vger.kernel.org
 +L:    linux-arch@vger.kernel.org
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
  F:    tools/memory-model/
 +F:    Documentation/atomic_bitops.txt
 +F:    Documentation/atomic_t.txt
 +F:    Documentation/core-api/atomic_ops.rst
 +F:    Documentation/core-api/refcount-vs-atomic.rst
  F:    Documentation/memory-barriers.txt
  
 -LINUX SECURITY MODULE (LSM) FRAMEWORK
 -M:    Chris Wright <chrisw@sous-sol.org>
 -L:    linux-security-module@vger.kernel.org
 -S:    Supported
 -
  LIS3LV02D ACCELEROMETER DRIVER
  M:    Eric Piel <eric.piel@tremplin-utc.net>
  S:    Maintained
@@@ -8644,7 -8629,7 +8644,7 @@@ MARVELL MWIFIEX WIRELESS DRIVE
  M:    Amitkumar Karwar <amitkarwar@gmail.com>
  M:    Nishant Sarmukadam <nishants@marvell.com>
  M:    Ganapathi Bhat <gbhat@marvell.com>
 -M:    Xinming Hu <huxm@marvell.com>
 +M:    Xinming Hu <huxinming820@gmail.com>
  L:    linux-wireless@vger.kernel.org
  S:    Maintained
  F:    drivers/net/wireless/marvell/mwifiex/
@@@ -9090,7 -9075,7 +9090,7 @@@ S:      Maintaine
  F:    drivers/usb/mtu3/
  
  MEGACHIPS STDPXXXX-GE-B850V3-FW LVDS/DP++ BRIDGES
 -M:    Peter Senna Tschudin <peter.senna@collabora.com>
 +M:    Peter Senna Tschudin <peter.senna@gmail.com>
  M:    Martin Donnelly <martin.donnelly@ge.com>
  M:    Martyn Welch <martyn.welch@collabora.co.uk>
  S:    Maintained
@@@ -9361,6 -9346,7 +9361,6 @@@ F:      drivers/media/platform/atmel/atmel-i
  F:    devicetree/bindings/media/atmel-isc.txt
  
  MICROCHIP / ATMEL NAND DRIVER
 -M:    Wenyou Yang <wenyou.yang@microchip.com>
  M:    Josh Wu <rainyfeeling@outlook.com>
  L:    linux-mtd@lists.infradead.org
  S:    Supported
@@@ -9770,11 -9756,6 +9770,11 @@@ L:    linux-scsi@vger.kernel.or
  S:    Maintained
  F:    drivers/scsi/NCR_D700.*
  
 +NCSI LIBRARY:
 +M:    Samuel Mendoza-Jonas <sam@mendozajonas.com>
 +S:    Maintained
 +F:    net/ncsi/
 +
  NCT6775 HARDWARE MONITOR DRIVER
  M:    Guenter Roeck <linux@roeck-us.net>
  L:    linux-hwmon@vger.kernel.org
@@@ -9901,7 -9882,6 +9901,7 @@@ M:      Andrew Lunn <andrew@lunn.ch
  M:    Vivien Didelot <vivien.didelot@savoirfairelinux.com>
  M:    Florian Fainelli <f.fainelli@gmail.com>
  S:    Maintained
 +F:    Documentation/devicetree/bindings/net/dsa/
  F:    net/dsa/
  F:    include/net/dsa.h
  F:    include/linux/dsa/
@@@ -10228,13 -10208,11 +10228,13 @@@ F:        sound/soc/codecs/sgtl5000
  
  NXP TDA998X DRM DRIVER
  M:    Russell King <linux@armlinux.org.uk>
 -S:    Supported
 +S:    Maintained
  T:    git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-devel
  T:    git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-tda998x-fixes
  F:    drivers/gpu/drm/i2c/tda998x_drv.c
  F:    include/drm/i2c/tda998x.h
 +F:    include/dt-bindings/display/tda998x.h
 +K:    "nxp,tda998x"
  
  NXP TFA9879 DRIVER
  M:    Peter Rosin <peda@axentia.se>
@@@ -11271,7 -11249,7 +11271,7 @@@ F:   Documentation/devicetree/bindings/pi
  
  PIN CONTROLLER - INTEL
  M:    Mika Westerberg <mika.westerberg@linux.intel.com>
 -M:    Heikki Krogerus <heikki.krogerus@linux.intel.com>
 +M:    Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  S:    Maintained
  F:    drivers/pinctrl/intel/
  
@@@ -11498,15 -11476,6 +11498,15 @@@ W: http://wireless.kernel.org/en/users/
  S:    Obsolete
  F:    drivers/net/wireless/intersil/prism54/
  
 +PROC FILESYSTEM
 +R:    Alexey Dobriyan <adobriyan@gmail.com>
 +L:    linux-kernel@vger.kernel.org
 +L:    linux-fsdevel@vger.kernel.org
 +S:    Maintained
 +F:    fs/proc/
 +F:    include/linux/proc_fs.h
 +F:    tools/testing/selftests/proc/
 +
  PROC SYSCTL
  M:    "Luis R. Rodriguez" <mcgrof@kernel.org>
  M:    Kees Cook <keescook@chromium.org>
@@@ -11839,9 -11808,9 +11839,9 @@@ F:  Documentation/devicetree/bindings/o
  F:  drivers/cpufreq/qcom-cpufreq-kryo.c
  
  QUALCOMM EMAC GIGABIT ETHERNET DRIVER
 -M:    Timur Tabi <timur@codeaurora.org>
 +M:    Timur Tabi <timur@kernel.org>
  L:    netdev@vger.kernel.org
 -S:    Supported
 +S:    Maintained
  F:    drivers/net/ethernet/qualcomm/emac/
  
  QUALCOMM HEXAGON ARCHITECTURE
@@@ -11852,7 -11821,7 +11852,7 @@@ S:   Supporte
  F:    arch/hexagon/
  
  QUALCOMM HIDMA DRIVER
 -M:    Sinan Kaya <okaya@codeaurora.org>
 +M:    Sinan Kaya <okaya@kernel.org>
  L:    linux-arm-kernel@lists.infradead.org
  L:    linux-arm-msm@vger.kernel.org
  L:    dmaengine@vger.kernel.org
@@@ -12052,9 -12021,9 +12052,9 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    Documentation/RCU/
  X:    Documentation/RCU/torture.txt
  F:    include/linux/rcu*
 -X:    include/linux/srcu.h
 +X:    include/linux/srcu*.h
  F:    kernel/rcu/
 -X:    kernel/torture.c
 +X:    kernel/rcu/srcu*.c
  
  REAL TIME CLOCK (RTC) SUBSYSTEM
  M:    Alessandro Zummo <a.zummo@towertech.it>
@@@ -12415,6 -12384,7 +12415,6 @@@ F:   drivers/pci/hotplug/s390_pci_hpc.
  
  S390 VFIO-CCW DRIVER
  M:    Cornelia Huck <cohuck@redhat.com>
 -M:    Dong Jia Shi <bjsdjshi@linux.ibm.com>
  M:    Halil Pasic <pasic@linux.ibm.com>
  L:    linux-s390@vger.kernel.org
  L:    kvm@vger.kernel.org
@@@ -12799,6 -12769,7 +12799,7 @@@ T:   git git://git.kernel.org/pub/scm/lin
  W:    http://kernsec.org/
  S:    Supported
  F:    security/
+ X:    security/selinux/
  
  SELINUX SECURITY MODULE
  M:    Paul Moore <paul@paul-moore.com>
@@@ -13090,8 -13061,8 +13091,8 @@@ L:   linux-kernel@vger.kernel.or
  W:    http://www.rdrop.com/users/paulmck/RCU/
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
 -F:    include/linux/srcu.h
 -F:    kernel/rcu/srcu.c
 +F:    include/linux/srcu*.h
 +F:    kernel/rcu/srcu*.c
  
  SERIAL LOW-POWER INTER-CHIP MEDIA BUS (SLIMbus)
  M:    Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
@@@ -13587,13 -13558,6 +13588,13 @@@ L: linux-block@vger.kernel.or
  S:    Maintained
  F:    drivers/block/skd*[ch]
  
 +STI AUDIO (ASoC) DRIVERS
 +M:    Arnaud Pouliquen <arnaud.pouliquen@st.com>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt
 +F:    sound/soc/sti/
 +
  STI CEC DRIVER
  M:    Benjamin Gaignard <benjamin.gaignard@linaro.org>
  S:    Maintained
@@@ -13607,14 -13571,6 +13608,14 @@@ T: git git://linuxtv.org/media_tree.gi
  S:    Maintained
  F:    drivers/media/usb/stk1160/
  
 +STM32 AUDIO (ASoC) DRIVERS
 +M:    Olivier Moysan <olivier.moysan@st.com>
 +M:    Arnaud Pouliquen <arnaud.pouliquen@st.com>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/sound/st,stm32-*.txt
 +F:    sound/soc/stm/
 +
  STM32 TIMER/LPTIMER DRIVERS
  M:    Fabrice Gasnier <fabrice.gasnier@st.com>
  S:    Maintained
@@@ -13693,7 -13649,7 +13694,7 @@@ M:   Konrad Rzeszutek Wilk <konrad.wilk@o
  L:    iommu@lists.linux-foundation.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git
  S:    Supported
 -F:    lib/swiotlb.c
 +F:    kernel/dma/swiotlb.c
  F:    arch/*/kernel/pci-swiotlb.c
  F:    include/linux/swiotlb.h
  
@@@ -14085,13 -14041,6 +14086,13 @@@ M: Laxman Dewangan <ldewangan@nvidia.co
  S:    Supported
  F:    drivers/input/keyboard/tegra-kbc.c
  
 +TEGRA NAND DRIVER
 +M:    Stefan Agner <stefan@agner.ch>
 +M:    Lucas Stach <dev@lynxeye.de>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/mtd/nvidia-tegra20-nand.txt
 +F:    drivers/mtd/nand/raw/tegra_nand.c
 +
  TEGRA PWM DRIVER
  M:    Thierry Reding <thierry.reding@gmail.com>
  S:    Supported
@@@ -14472,7 -14421,6 +14473,7 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    Documentation/RCU/torture.txt
  F:    kernel/torture.c
  F:    kernel/rcu/rcutorture.c
 +F:    kernel/rcu/rcuperf.c
  F:    kernel/locking/locktorture.c
  
  TOSHIBA ACPI EXTRAS DRIVER
@@@ -15625,17 -15573,9 +15626,17 @@@ M: x86@kernel.or
  L:    linux-kernel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
  S:    Maintained
 +F:    Documentation/devicetree/bindings/x86/
  F:    Documentation/x86/
  F:    arch/x86/
  
 +X86 ENTRY CODE
 +M:    Andy Lutomirski <luto@kernel.org>
 +L:    linux-kernel@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/asm
 +S:    Maintained
 +F:    arch/x86/entry/
 +
  X86 MCE INFRASTRUCTURE
  M:    Tony Luck <tony.luck@intel.com>
  M:    Borislav Petkov <bp@alien8.de>
@@@ -15658,7 -15598,7 +15659,7 @@@ F:   drivers/platform/x86
  F:    drivers/platform/olpc/
  
  X86 VDSO
 -M:    Andy Lutomirski <luto@amacapital.net>
 +M:    Andy Lutomirski <luto@kernel.org>
  L:    linux-kernel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vdso
  S:    Maintained
diff --combined security/selinux/hooks.c
@@@ -530,7 -530,7 +530,7 @@@ static int sb_finish_set_opts(struct su
                   the first boot of the SELinux kernel before we have
                   assigned xattr values to the filesystem. */
                if (!(root_inode->i_opflags & IOP_XATTR)) {
-                       printk(KERN_WARNING "SELinux: (dev %s, type %s) has no "
+                       pr_warn("SELinux: (dev %s, type %s) has no "
                               "xattr support\n", sb->s_id, sb->s_type->name);
                        rc = -EOPNOTSUPP;
                        goto out;
                rc = __vfs_getxattr(root, root_inode, XATTR_NAME_SELINUX, NULL, 0);
                if (rc < 0 && rc != -ENODATA) {
                        if (rc == -EOPNOTSUPP)
-                               printk(KERN_WARNING "SELinux: (dev %s, type "
+                               pr_warn("SELinux: (dev %s, type "
                                       "%s) has no security xattr handler\n",
                                       sb->s_id, sb->s_type->name);
                        else
-                               printk(KERN_WARNING "SELinux: (dev %s, type "
+                               pr_warn("SELinux: (dev %s, type "
                                       "%s) getxattr errno %d\n", sb->s_id,
                                       sb->s_type->name, -rc);
                        goto out;
@@@ -742,7 -742,7 +742,7 @@@ static int selinux_set_mnt_opts(struct 
                        goto out;
                }
                rc = -EINVAL;
-               printk(KERN_WARNING "SELinux: Unable to set superblock options "
+               pr_warn("SELinux: Unable to set superblock options "
                        "before the security server is initialized\n");
                goto out;
        }
                                                 mount_options[i], &sid,
                                                 GFP_KERNEL);
                if (rc) {
-                       printk(KERN_WARNING "SELinux: security_context_str_to_sid"
+                       pr_warn("SELinux: security_context_str_to_sid"
                               "(%s) failed for (dev %s, type %s) errno=%d\n",
                               mount_options[i], sb->s_id, name, rc);
                        goto out;
                 */
                rc = security_fs_use(&selinux_state, sb);
                if (rc) {
-                       printk(KERN_WARNING
-                               "%s: security_fs_use(%s) returned %d\n",
+                       pr_warn("%s: security_fs_use(%s) returned %d\n",
                                        __func__, sb->s_type->name, rc);
                        goto out;
                }
                if (sbsec->behavior != SECURITY_FS_USE_XATTR &&
                        sbsec->behavior != SECURITY_FS_USE_NATIVE) {
                        rc = -EINVAL;
-                       printk(KERN_WARNING "SELinux: defcontext option is "
+                       pr_warn("SELinux: defcontext option is "
                               "invalid for this filesystem type\n");
                        goto out;
                }
@@@ -969,7 -968,7 +968,7 @@@ out
        return rc;
  out_double_mount:
        rc = -EINVAL;
-       printk(KERN_WARNING "SELinux: mount invalid.  Same superblock, different "
+       pr_warn("SELinux: mount invalid.  Same superblock, different "
               "security settings for (dev %s, type %s)\n", sb->s_id, name);
        goto out;
  }
@@@ -998,7 -997,7 +997,7 @@@ static int selinux_cmp_sb_context(cons
        }
        return 0;
  mismatch:
-       printk(KERN_WARNING "SELinux: mount invalid.  Same superblock, "
+       pr_warn("SELinux: mount invalid.  Same superblock, "
                            "different security settings for (dev %s, "
                            "type %s)\n", newsb->s_id, newsb->s_type->name);
        return -EBUSY;
@@@ -1106,7 -1105,7 +1105,7 @@@ static int selinux_parse_opts_str(char 
                case Opt_context:
                        if (context || defcontext) {
                                rc = -EINVAL;
-                               printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
+                               pr_warn(SEL_MOUNT_FAIL_MSG);
                                goto out_err;
                        }
                        context = match_strdup(&args[0]);
                case Opt_fscontext:
                        if (fscontext) {
                                rc = -EINVAL;
-                               printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
+                               pr_warn(SEL_MOUNT_FAIL_MSG);
                                goto out_err;
                        }
                        fscontext = match_strdup(&args[0]);
                case Opt_rootcontext:
                        if (rootcontext) {
                                rc = -EINVAL;
-                               printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
+                               pr_warn(SEL_MOUNT_FAIL_MSG);
                                goto out_err;
                        }
                        rootcontext = match_strdup(&args[0]);
                case Opt_defcontext:
                        if (context || defcontext) {
                                rc = -EINVAL;
-                               printk(KERN_WARNING SEL_MOUNT_FAIL_MSG);
+                               pr_warn(SEL_MOUNT_FAIL_MSG);
                                goto out_err;
                        }
                        defcontext = match_strdup(&args[0]);
                        break;
                default:
                        rc = -EINVAL;
-                       printk(KERN_WARNING "SELinux:  unknown mount option\n");
+                       pr_warn("SELinux:  unknown mount option\n");
                        goto out_err;
  
                }
@@@ -1623,7 -1622,7 +1622,7 @@@ static int inode_doinit_with_dentry(str
                dput(dentry);
                if (rc < 0) {
                        if (rc != -ENODATA) {
-                               printk(KERN_WARNING "SELinux: %s:  getxattr returned "
+                               pr_warn("SELinux: %s:  getxattr returned "
                                       "%d for dev=%s ino=%ld\n", __func__,
                                       -rc, inode->i_sb->s_id, inode->i_ino);
                                kfree(context);
  
                                if (rc == -EINVAL) {
                                        if (printk_ratelimit())
-                                               printk(KERN_NOTICE "SELinux: inode=%lu on dev=%s was found to have an invalid "
+                                               pr_notice("SELinux: inode=%lu on dev=%s was found to have an invalid "
                                                        "context=%s.  This indicates you may need to relabel the inode or the "
                                                        "filesystem in question.\n", ino, dev, context);
                                } else {
-                                       printk(KERN_WARNING "SELinux: %s:  context_to_sid(%s) "
+                                       pr_warn("SELinux: %s:  context_to_sid(%s) "
                                               "returned %d for dev=%s ino=%ld\n",
                                               __func__, context, -rc, dev, ino);
                                }
@@@ -1785,8 -1784,7 +1784,7 @@@ static int cred_has_capability(const st
                sclass = initns ? SECCLASS_CAPABILITY2 : SECCLASS_CAP2_USERNS;
                break;
        default:
-               printk(KERN_ERR
-                      "SELinux:  out of range capability %d\n", cap);
+               pr_err("SELinux:  out of range capability %d\n", cap);
                BUG();
                return -EINVAL;
        }
@@@ -2029,7 -2027,7 +2027,7 @@@ static int may_link(struct inode *dir
                av = DIR__RMDIR;
                break;
        default:
-               printk(KERN_WARNING "SELinux: %s:  unrecognized kind %d\n",
+               pr_warn("SELinux: %s:  unrecognized kind %d\n",
                        __func__, kind);
                return 0;
        }
@@@ -2875,7 -2873,7 +2873,7 @@@ static int selinux_sb_remount(struct su
                                                 mount_options[i], &sid,
                                                 GFP_KERNEL);
                if (rc) {
-                       printk(KERN_WARNING "SELinux: security_context_str_to_sid"
+                       pr_warn("SELinux: security_context_str_to_sid"
                               "(%s) failed for (dev %s, type %s) errno=%d\n",
                               mount_options[i], sb->s_id, sb->s_type->name, rc);
                        goto out_free_opts;
@@@ -2914,7 -2912,7 +2912,7 @@@ out_free_secdata
        free_secdata(secdata);
        return rc;
  out_bad_option:
-       printk(KERN_WARNING "SELinux: unable to change security options "
+       pr_warn("SELinux: unable to change security options "
               "during remount (dev %s, type=%s)\n", sb->s_id,
               sb->s_type->name);
        goto out_free_opts;
@@@ -3357,7 -3355,7 +3355,7 @@@ static void selinux_inode_post_setxattr
        rc = security_context_to_sid_force(&selinux_state, value, size,
                                           &newsid);
        if (rc) {
-               printk(KERN_ERR "SELinux:  unable to map context to SID"
+               pr_err("SELinux:  unable to map context to SID"
                       "for (%s, %lu), rc=%d\n",
                       inode->i_sb->s_id, inode->i_ino, -rc);
                return;
@@@ -3862,7 -3860,7 +3860,7 @@@ static int selinux_file_receive(struct 
        return file_has_perm(cred, file, file_to_av(file));
  }
  
 -static int selinux_file_open(struct file *file, const struct cred *cred)
 +static int selinux_file_open(struct file *file)
  {
        struct file_security_struct *fsec;
        struct inode_security_struct *isec;
         * new inode label or new policy.
         * This check is not redundant - do not remove.
         */
 -      return file_path_has_perm(cred, file, open_file_to_av(file));
 +      return file_path_has_perm(file->f_cred, file, open_file_to_av(file));
  }
  
  /* task security operations */
@@@ -4073,20 -4071,6 +4071,20 @@@ static int selinux_kernel_read_file(str
        return rc;
  }
  
 +static int selinux_kernel_load_data(enum kernel_load_data_id id)
 +{
 +      int rc = 0;
 +
 +      switch (id) {
 +      case LOADING_MODULE:
 +              rc = selinux_kernel_module_from_file(NULL);
 +      default:
 +              break;
 +      }
 +
 +      return rc;
 +}
 +
  static int selinux_task_setpgid(struct task_struct *p, pid_t pgid)
  {
        return avc_has_perm(&selinux_state,
@@@ -4434,7 -4418,7 +4432,7 @@@ static int selinux_parse_skb(struct sk_
        }
  
  parse_error:
-       printk(KERN_WARNING
+       pr_warn(
               "SELinux: failure in selinux_parse_skb(),"
               " unable to parse packet\n");
        return ret;
@@@ -4477,7 -4461,7 +4475,7 @@@ static int selinux_skb_peerlbl_sid(stru
        err = security_net_peersid_resolve(&selinux_state, nlbl_sid,
                                           nlbl_type, xfrm_sid, sid);
        if (unlikely(err)) {
-               printk(KERN_WARNING
+               pr_warn(
                       "SELinux: failure in selinux_skb_peerlbl_sid(),"
                       " unable to determine packet's peer label\n");
                return -EACCES;
@@@ -6986,7 -6970,6 +6984,7 @@@ static struct security_hook_list selinu
        LSM_HOOK_INIT(kernel_act_as, selinux_kernel_act_as),
        LSM_HOOK_INIT(kernel_create_files_as, selinux_kernel_create_files_as),
        LSM_HOOK_INIT(kernel_module_request, selinux_kernel_module_request),
 +      LSM_HOOK_INIT(kernel_load_data, selinux_kernel_load_data),
        LSM_HOOK_INIT(kernel_read_file, selinux_kernel_read_file),
        LSM_HOOK_INIT(task_setpgid, selinux_task_setpgid),
        LSM_HOOK_INIT(task_getpgid, selinux_task_getpgid),
@@@ -7141,11 -7124,11 +7139,11 @@@ static __init int selinux_init(void
        }
  
        if (!selinux_enabled) {
-               printk(KERN_INFO "SELinux:  Disabled at boot.\n");
+               pr_info("SELinux:  Disabled at boot.\n");
                return 0;
        }
  
-       printk(KERN_INFO "SELinux:  Initializing.\n");
+       pr_info("SELinux:  Initializing.\n");
  
        memset(&selinux_state, 0, sizeof(selinux_state));
        enforcing_set(&selinux_state, selinux_enforcing_boot);
                panic("SELinux: Unable to register AVC LSM notifier callback\n");
  
        if (selinux_enforcing_boot)
-               printk(KERN_DEBUG "SELinux:  Starting in enforcing mode\n");
+               pr_debug("SELinux:  Starting in enforcing mode\n");
        else
-               printk(KERN_DEBUG "SELinux:  Starting in permissive mode\n");
+               pr_debug("SELinux:  Starting in permissive mode\n");
  
        return 0;
  }
@@@ -7195,10 -7178,10 +7193,10 @@@ static void delayed_superblock_init(str
  
  void selinux_complete_init(void)
  {
-       printk(KERN_DEBUG "SELinux:  Completing initialization.\n");
+       pr_debug("SELinux:  Completing initialization.\n");
  
        /* Set up any superblocks initialized prior to the policy load. */
-       printk(KERN_DEBUG "SELinux:  Setting up existing superblocks.\n");
+       pr_debug("SELinux:  Setting up existing superblocks.\n");
        iterate_supers(delayed_superblock_init, NULL);
  }
  
@@@ -7273,7 -7256,7 +7271,7 @@@ static int __init selinux_nf_ip_init(vo
        if (!selinux_enabled)
                return 0;
  
-       printk(KERN_DEBUG "SELinux:  Registering netfilter hooks\n");
+       pr_debug("SELinux:  Registering netfilter hooks\n");
  
        err = register_pernet_subsys(&selinux_net_ops);
        if (err)
@@@ -7286,7 -7269,7 +7284,7 @@@ __initcall(selinux_nf_ip_init)
  #ifdef CONFIG_SECURITY_SELINUX_DISABLE
  static void selinux_nf_ip_exit(void)
  {
-       printk(KERN_DEBUG "SELinux:  Unregistering netfilter hooks\n");
+       pr_debug("SELinux:  Unregistering netfilter hooks\n");
  
        unregister_pernet_subsys(&selinux_net_ops);
  }
@@@ -7315,7 -7298,7 +7313,7 @@@ int selinux_disable(struct selinux_stat
  
        state->disabled = 1;
  
-       printk(KERN_INFO "SELinux:  Disabled at runtime.\n");
+       pr_info("SELinux:  Disabled at runtime.\n");
  
        selinux_enabled = 0;
  
@@@ -441,16 -441,22 +441,16 @@@ static int sel_release_policy(struct in
  static ssize_t sel_read_policy(struct file *filp, char __user *buf,
                               size_t count, loff_t *ppos)
  {
 -      struct selinux_fs_info *fsi = file_inode(filp)->i_sb->s_fs_info;
        struct policy_load_memory *plm = filp->private_data;
        int ret;
  
 -      mutex_lock(&fsi->mutex);
 -
        ret = avc_has_perm(&selinux_state,
                           current_sid(), SECINITSID_SECURITY,
                          SECCLASS_SECURITY, SECURITY__READ_POLICY, NULL);
        if (ret)
 -              goto out;
 +              return ret;
  
 -      ret = simple_read_from_buffer(buf, count, ppos, plm->data, plm->len);
 -out:
 -      mutex_unlock(&fsi->mutex);
 -      return ret;
 +      return simple_read_from_buffer(buf, count, ppos, plm->data, plm->len);
  }
  
  static vm_fault_t sel_mmap_policy_fault(struct vm_fault *vmf)
@@@ -614,7 -620,7 +614,7 @@@ static ssize_t sel_write_context(struc
  
        length = -ERANGE;
        if (len > SIMPLE_TRANSACTION_LIMIT) {
-               printk(KERN_ERR "SELinux: %s:  context size (%u) exceeds "
+               pr_err("SELinux: %s:  context size (%u) exceeds "
                        "payload max\n", __func__, len);
                goto out;
        }
@@@ -767,7 -773,7 +767,7 @@@ static ssize_t sel_write_relabel(struc
  static ssize_t sel_write_user(struct file *file, char *buf, size_t size);
  static ssize_t sel_write_member(struct file *file, char *buf, size_t size);
  
- static ssize_t (*write_op[])(struct file *, char *, size_t) = {
+ static ssize_t (*const write_op[])(struct file *, char *, size_t) = {
        [SEL_ACCESS] = sel_write_access,
        [SEL_CREATE] = sel_write_create,
        [SEL_RELABEL] = sel_write_relabel,
@@@ -950,7 -956,7 +950,7 @@@ static ssize_t sel_write_create(struct 
  
        length = -ERANGE;
        if (len > SIMPLE_TRANSACTION_LIMIT) {
-               printk(KERN_ERR "SELinux: %s:  context size (%u) exceeds "
+               pr_err("SELinux: %s:  context size (%u) exceeds "
                        "payload max\n", __func__, len);
                goto out;
        }
@@@ -1141,7 -1147,7 +1141,7 @@@ static ssize_t sel_write_member(struct 
  
        length = -ERANGE;
        if (len > SIMPLE_TRANSACTION_LIMIT) {
-               printk(KERN_ERR "SELinux: %s:  context size (%u) exceeds "
+               pr_err("SELinux: %s:  context size (%u) exceeds "
                        "payload max\n", __func__, len);
                goto out;
        }
@@@ -1182,29 -1188,25 +1182,29 @@@ static ssize_t sel_read_bool(struct fil
        ret = -EINVAL;
        if (index >= fsi->bool_num || strcmp(name,
                                             fsi->bool_pending_names[index]))
 -              goto out;
 +              goto out_unlock;
  
        ret = -ENOMEM;
        page = (char *)get_zeroed_page(GFP_KERNEL);
        if (!page)
 -              goto out;
 +              goto out_unlock;
  
        cur_enforcing = security_get_bool_value(fsi->state, index);
        if (cur_enforcing < 0) {
                ret = cur_enforcing;
 -              goto out;
 +              goto out_unlock;
        }
        length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing,
                          fsi->bool_pending_values[index]);
 -      ret = simple_read_from_buffer(buf, count, ppos, page, length);
 -out:
        mutex_unlock(&fsi->mutex);
 +      ret = simple_read_from_buffer(buf, count, ppos, page, length);
 +out_free:
        free_page((unsigned long)page);
        return ret;
 +
 +out_unlock:
 +      mutex_unlock(&fsi->mutex);
 +      goto out_free;
  }
  
  static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
        unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK;
        const char *name = filep->f_path.dentry->d_name.name;
  
 +      if (count >= PAGE_SIZE)
 +              return -ENOMEM;
 +
 +      /* No partial writes. */
 +      if (*ppos != 0)
 +              return -EINVAL;
 +
 +      page = memdup_user_nul(buf, count);
 +      if (IS_ERR(page))
 +              return PTR_ERR(page);
 +
        mutex_lock(&fsi->mutex);
  
        length = avc_has_perm(&selinux_state,
                                             fsi->bool_pending_names[index]))
                goto out;
  
 -      length = -ENOMEM;
 -      if (count >= PAGE_SIZE)
 -              goto out;
 -
 -      /* No partial writes. */
 -      length = -EINVAL;
 -      if (*ppos != 0)
 -              goto out;
 -
 -      page = memdup_user_nul(buf, count);
 -      if (IS_ERR(page)) {
 -              length = PTR_ERR(page);
 -              page = NULL;
 -              goto out;
 -      }
 -
        length = -EINVAL;
        if (sscanf(page, "%d", &new_value) != 1)
                goto out;
@@@ -1273,17 -1280,6 +1273,17 @@@ static ssize_t sel_commit_bools_write(s
        ssize_t length;
        int new_value;
  
 +      if (count >= PAGE_SIZE)
 +              return -ENOMEM;
 +
 +      /* No partial writes. */
 +      if (*ppos != 0)
 +              return -EINVAL;
 +
 +      page = memdup_user_nul(buf, count);
 +      if (IS_ERR(page))
 +              return PTR_ERR(page);
 +
        mutex_lock(&fsi->mutex);
  
        length = avc_has_perm(&selinux_state,
        if (length)
                goto out;
  
 -      length = -ENOMEM;
 -      if (count >= PAGE_SIZE)
 -              goto out;
 -
 -      /* No partial writes. */
 -      length = -EINVAL;
 -      if (*ppos != 0)
 -              goto out;
 -
 -      page = memdup_user_nul(buf, count);
 -      if (IS_ERR(page)) {
 -              length = PTR_ERR(page);
 -              page = NULL;
 -              goto out;
 -      }
 -
        length = -EINVAL;
        if (sscanf(page, "%d", &new_value) != 1)
                goto out;
@@@ -1365,13 -1377,18 +1365,18 @@@ static int sel_make_bools(struct selinu
  
                ret = -ENOMEM;
                inode = sel_make_inode(dir->d_sb, S_IFREG | S_IRUGO | S_IWUSR);
-               if (!inode)
+               if (!inode) {
+                       dput(dentry);
                        goto out;
+               }
  
                ret = -ENAMETOOLONG;
                len = snprintf(page, PAGE_SIZE, "/%s/%s", BOOL_DIR_NAME, names[i]);
-               if (len >= PAGE_SIZE)
+               if (len >= PAGE_SIZE) {
+                       dput(dentry);
+                       iput(inode);
                        goto out;
+               }
  
                isec = (struct inode_security_struct *)inode->i_security;
                ret = security_genfs_sid(fsi->state, "selinuxfs", page,
@@@ -1586,8 -1603,10 +1591,10 @@@ static int sel_make_avc_files(struct de
                        return -ENOMEM;
  
                inode = sel_make_inode(dir->d_sb, S_IFREG|files[i].mode);
-               if (!inode)
+               if (!inode) {
+                       dput(dentry);
                        return -ENOMEM;
+               }
  
                inode->i_fop = files[i].ops;
                inode->i_ino = ++fsi->last_ino;
@@@ -1632,8 -1651,10 +1639,10 @@@ static int sel_make_initcon_files(struc
                        return -ENOMEM;
  
                inode = sel_make_inode(dir->d_sb, S_IFREG|S_IRUGO);
-               if (!inode)
+               if (!inode) {
+                       dput(dentry);
                        return -ENOMEM;
+               }
  
                inode->i_fop = &sel_initcon_ops;
                inode->i_ino = i|SEL_INITCON_INO_OFFSET;
@@@ -1733,8 -1754,10 +1742,10 @@@ static int sel_make_perm_files(char *ob
  
                rc = -ENOMEM;
                inode = sel_make_inode(dir->d_sb, S_IFREG|S_IRUGO);
-               if (!inode)
+               if (!inode) {
+                       dput(dentry);
                        goto out;
+               }
  
                inode->i_fop = &sel_perm_ops;
                /* i+1 since perm values are 1-indexed */
@@@ -1763,8 -1786,10 +1774,10 @@@ static int sel_make_class_dir_entries(c
                return -ENOMEM;
  
        inode = sel_make_inode(dir->d_sb, S_IFREG|S_IRUGO);
-       if (!inode)
+       if (!inode) {
+               dput(dentry);
                return -ENOMEM;
+       }
  
        inode->i_fop = &sel_class_ops;
        inode->i_ino = sel_class_to_ino(index);
@@@ -1838,8 -1863,10 +1851,10 @@@ static int sel_make_policycap(struct se
                        return -ENOMEM;
  
                inode = sel_make_inode(fsi->sb, S_IFREG | 0444);
-               if (inode == NULL)
+               if (inode == NULL) {
+                       dput(dentry);
                        return -ENOMEM;
+               }
  
                inode->i_fop = &sel_policycap_ops;
                inode->i_ino = iter | SEL_POLICYCAP_INO_OFFSET;
@@@ -1932,8 -1959,10 +1947,10 @@@ static int sel_fill_super(struct super_
  
        ret = -ENOMEM;
        inode = sel_make_inode(sb, S_IFCHR | S_IRUGO | S_IWUGO);
-       if (!inode)
+       if (!inode) {
+               dput(dentry);
                goto err;
+       }
  
        inode->i_ino = ++fsi->last_ino;
        isec = (struct inode_security_struct *)inode->i_security;
                goto err;
        return 0;
  err:
-       printk(KERN_ERR "SELinux: %s:  failed while creating inodes\n",
+       pr_err("SELinux: %s:  failed while creating inodes\n",
                __func__);
  
        selinux_fs_info_free(sb);
@@@ -2034,7 -2063,7 +2051,7 @@@ static int __init init_sel_fs(void
  
        selinux_null.mnt = selinuxfs_mount = kern_mount(&sel_fs_type);
        if (IS_ERR(selinuxfs_mount)) {
-               printk(KERN_ERR "selinuxfs:  could not mount!\n");
+               pr_err("selinuxfs:  could not mount!\n");
                err = PTR_ERR(selinuxfs_mount);
                selinuxfs_mount = NULL;
        }