summaryrefslogtreecommitdiffstats
path: root/recipes-security
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2019-11-14 09:48:46 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2019-12-19 11:09:21 -0500
commit5e3643b618a2a01304165dc1b80f6d784742dc70 (patch)
tree88dbe48b3d976eefa7b3d7a681099880853c4833 /recipes-security
parent5fbf7227c937324776586c27a99def853aae3a7a (diff)
downloadmeta-selinux-5e3643b618a2a01304165dc1b80f6d784742dc70.tar.gz
libselinux: uprev to 2.9 (20190315)
* Switch to python3 * Drop patches: 0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch 0001-src-Makefile-fix-includedir-in-libselinux.pc.patch * Split into libselinux recipe and libselinux-python recipe to fix the loop dependency error. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'recipes-security')
-rw-r--r--recipes-security/selinux/libselinux.inc24
-rw-r--r--recipes-security/selinux/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch60
-rw-r--r--recipes-security/selinux/libselinux/0001-src-Makefile-fix-includedir-in-libselinux.pc.patch28
-rw-r--r--recipes-security/selinux/libselinux_2.9.bb (renamed from recipes-security/selinux/libselinux_2.8.bb)10
4 files changed, 6 insertions, 116 deletions
diff --git a/recipes-security/selinux/libselinux.inc b/recipes-security/selinux/libselinux.inc
index 6e115e3..8d381de 100644
--- a/recipes-security/selinux/libselinux.inc
+++ b/recipes-security/selinux/libselinux.inc
@@ -5,15 +5,10 @@ decisions. Required for any applications that use the SELinux API."
5SECTION = "base" 5SECTION = "base"
6LICENSE = "PD" 6LICENSE = "PD"
7 7
8inherit lib_package pythonnative 8inherit lib_package python3native
9 9
10DEPENDS += "libsepol python libpcre swig-native" 10DEPENDS += "libsepol libpcre"
11DEPENDS_append_libc-musl = " fts" 11DEPENDS_append_libc-musl = " fts"
12RDEPENDS_${PN}-python += "python-core python-shell"
13
14PACKAGES += "${PN}-python"
15FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
16FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/selinux/.debug/*"
17 12
18def get_policyconfigarch(d): 13def get_policyconfigarch(d):
19 import re 14 import re
@@ -26,19 +21,4 @@ EXTRA_OEMAKE += "${@get_policyconfigarch(d)}"
26EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre' LIBSEPOLA='${STAGING_LIBDIR}/libsepol.a'" 21EXTRA_OEMAKE += "LDFLAGS='${LDFLAGS} -lpcre' LIBSEPOLA='${STAGING_LIBDIR}/libsepol.a'"
27EXTRA_OEMAKE_append_libc-musl = " FTS_LDLIBS=-lfts" 22EXTRA_OEMAKE_append_libc-musl = " FTS_LDLIBS=-lfts"
28 23
29do_compile_append() {
30 oe_runmake pywrap -j1 \
31 INCLUDEDIR='${STAGING_INCDIR}' \
32 LIBDIR='${STAGING_LIBDIR}' \
33 PYINC='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}'
34}
35
36do_install_append() {
37 oe_runmake install-pywrap swigify \
38 PYTHONLIBDIR=${D}${libdir}/python${PYTHON_BASEVERSION}/site-packages
39 if ! ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','true','false',d)}; then
40 rm -rf ${D}${base_sbindir}
41 fi
42}
43
44BBCLASSEXTEND = "native" 24BBCLASSEXTEND = "native"
diff --git a/recipes-security/selinux/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch b/recipes-security/selinux/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch
deleted file mode 100644
index fc3e37e..0000000
--- a/recipes-security/selinux/libselinux/0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1From 2c672b4cc39fbddb6faec2c7434832058f339d59 Mon Sep 17 00:00:00 2001
2From: Petr Lautrbach <plautrba@redhat.com>
3Date: Mon, 11 Mar 2019 16:00:41 +0100
4Subject: [PATCH] libselinux: Do not define gettid() if glibc >= 2.30 is used
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Since version 2.30 glibc implements gettid() system call wrapper, see
10https://sourceware.org/bugzilla/show_bug.cgi?id=6399
11
12Fixes:
13cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I../include -D_GNU_SOURCE -DNO_ANDROID_BACKEND -c -o procattr.o procattr.c
14procattr.c:28:14: error: static declaration of ‘gettid’ follows non-static declaration
15 28 | static pid_t gettid(void)
16 | ^~~~~~
17In file included from /usr/include/unistd.h:1170,
18 from procattr.c:2:
19/usr/include/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here
20 34 | extern __pid_t gettid (void) __THROW;
21 | ^~~~~~
22
23Upstream-Status: Backport
24[https://github.com/SELinuxProject/selinux/commit/707e4b8610733b5c9eaac0f00239778f3edb23c2]
25
26Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
27Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
28---
29 src/procattr.c | 15 +++++++++++++--
30 1 file changed, 13 insertions(+), 2 deletions(-)
31
32diff --git a/src/procattr.c b/src/procattr.c
33index 8bf8432..3c7b87f 100644
34--- a/src/procattr.c
35+++ b/src/procattr.c
36@@ -22,8 +22,19 @@ static pthread_key_t destructor_key;
37 static int destructor_key_initialized = 0;
38 static __thread char destructor_initialized;
39
40-#ifndef __BIONIC__
41-/* Bionic declares this in unistd.h and has a definition for it */
42+/* Bionic and glibc >= 2.30 declare gettid() system call wrapper in unistd.h and
43+ * has a definition for it */
44+#ifdef __BIONIC__
45+ #define OVERRIDE_GETTID 0
46+#elif !defined(__GLIBC_PREREQ)
47+ #define OVERRIDE_GETTID 1
48+#elif !__GLIBC_PREREQ(2,30)
49+ #define OVERRIDE_GETTID 1
50+#else
51+ #define OVERRIDE_GETTID 0
52+#endif
53+
54+#if OVERRIDE_GETTID
55 static pid_t gettid(void)
56 {
57 return syscall(__NR_gettid);
58--
592.7.4
60
diff --git a/recipes-security/selinux/libselinux/0001-src-Makefile-fix-includedir-in-libselinux.pc.patch b/recipes-security/selinux/libselinux/0001-src-Makefile-fix-includedir-in-libselinux.pc.patch
deleted file mode 100644
index 46cfaaf..0000000
--- a/recipes-security/selinux/libselinux/0001-src-Makefile-fix-includedir-in-libselinux.pc.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 37f3299e8f5c468fe692f36356c2c35f968b6aee Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 18 Feb 2016 02:39:16 +0000
4Subject: [PATCH] src/Makefile: fix includedir in libselinux.pc
5
6Upstream-Status: Pending
7
8Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
9Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
10---
11 src/Makefile | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/src/Makefile b/src/Makefile
15index 977b5c8..92a4289 100644
16--- a/src/Makefile
17+++ b/src/Makefile
18@@ -156,6 +156,7 @@ $(LIBSO): $(LOBJS)
19
20 $(LIBPC): $(LIBPC).in ../VERSION
21 sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):; s:@PCRE_MODULE@:$(PCRE_MODULE):' < $< > $@
22+ sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:${libdir}:; s:@includedir@:${prefix}/include:; s:@PCRE_MODULE@:$(PCRE_MODULE):' < $< > $@
23
24 selinuxswig_python_exception.i: ../include/selinux/selinux.h
25 bash -e exception.sh > $@ || (rm -f $@ ; false)
26--
272.7.4
28
diff --git a/recipes-security/selinux/libselinux_2.8.bb b/recipes-security/selinux/libselinux_2.9.bb
index 7545967..f04bc4a 100644
--- a/recipes-security/selinux/libselinux_2.8.bb
+++ b/recipes-security/selinux/libselinux_2.9.bb
@@ -1,16 +1,14 @@
1include selinux_20180524.inc 1require selinux_20190315.inc
2include ${BPN}.inc 2require ${BPN}.inc
3 3
4LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" 4LIC_FILES_CHKSUM = "file://LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0"
5 5
6SRC_URI[md5sum] = "56057e60192b21122c1aede8ff723ca2" 6SRC_URI[md5sum] = "bb449431b6ed55a0a0496dbc366d6e31"
7SRC_URI[sha256sum] = "31db96ec7643ce10912b3c3f98506a08a9116dcfe151855fd349c3fda96187e1" 7SRC_URI[sha256sum] = "1bccc8873e449587d9a2b2cf253de9b89a8291b9fbc7c59393ca9e5f5f4d2693"
8 8
9SRC_URI += "\ 9SRC_URI += "\
10 file://libselinux-drop-Wno-unused-but-set-variable.patch \ 10 file://libselinux-drop-Wno-unused-but-set-variable.patch \
11 file://libselinux-make-O_CLOEXEC-optional.patch \ 11 file://libselinux-make-O_CLOEXEC-optional.patch \
12 file://libselinux-make-SOCK_CLOEXEC-optional.patch \ 12 file://libselinux-make-SOCK_CLOEXEC-optional.patch \
13 file://libselinux-define-FD_CLOEXEC-as-necessary.patch \ 13 file://libselinux-define-FD_CLOEXEC-as-necessary.patch \
14 file://0001-src-Makefile-fix-includedir-in-libselinux.pc.patch \
15 file://0001-libselinux-Do-not-define-gettid-if-glibc-2.30-is-use.patch \
16 " 14 "