Browse Source

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

Pull SElinux fix from James Morris:
 "From Paul:
   'A small SELinux patch to fix some clang/llvm compiler warnings and
    ensure the tools under scripts work well in the face of kernel
    changes'"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  selinux: use the kernel headers when building scripts/selinux
Linus Torvalds 8 năm trước cách đây
mục cha
commit
67327145c4

+ 3 - 1
scripts/selinux/genheaders/Makefile

@@ -1,4 +1,6 @@
 hostprogs-y	:= genheaders
 hostprogs-y	:= genheaders
-HOST_EXTRACFLAGS += -Isecurity/selinux/include
+HOST_EXTRACFLAGS += \
+	-I$(srctree)/include/uapi -I$(srctree)/include \
+	-I$(srctree)/security/selinux/include
 
 
 always		:= $(hostprogs-y)
 always		:= $(hostprogs-y)

+ 4 - 0
scripts/selinux/genheaders/genheaders.c

@@ -1,3 +1,7 @@
+
+/* NOTE: we really do want to use the kernel headers here */
+#define __EXPORTED_HEADERS__
+
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <unistd.h>

+ 3 - 1
scripts/selinux/mdp/Makefile

@@ -1,5 +1,7 @@
 hostprogs-y	:= mdp
 hostprogs-y	:= mdp
-HOST_EXTRACFLAGS += -Isecurity/selinux/include
+HOST_EXTRACFLAGS += \
+	-I$(srctree)/include/uapi -I$(srctree)/include \
+	-I$(srctree)/security/selinux/include
 
 
 always		:= $(hostprogs-y)
 always		:= $(hostprogs-y)
 clean-files	:= policy.* file_contexts
 clean-files	:= policy.* file_contexts

+ 4 - 0
scripts/selinux/mdp/mdp.c

@@ -24,6 +24,10 @@
  * Authors: Serge E. Hallyn <serue@us.ibm.com>
  * Authors: Serge E. Hallyn <serue@us.ibm.com>
  */
  */
 
 
+
+/* NOTE: we really do want to use the kernel headers here */
+#define __EXPORTED_HEADERS__
+
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <unistd.h>

+ 2 - 0
security/selinux/include/classmap.h

@@ -1,3 +1,5 @@
+#include <linux/capability.h>
+
 #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
 #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
     "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append"
     "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append"