Skip to contentSkip to conversation

checkpolicy: remove unused te_assertions

PATCH New Yu, Mingli 1 participant 1 message Jun 18, 2020

lore
Share & tools
lore

Yu, Mingli

author
#0 lore raw

PATCH 1/1 checkpolicy: remove unused te_assertions

From: Mingli Yu <[email protected]>

Backport a patch to remove unused te_assertions to fix the build failure on fedora 32.

Fixes:

 | /build/tmp-glibc/hosttools/ld: policy_define.o:(.bss+0x28): multiple definition of `te_assertions'/build/tmp-glibc/hosttools/ld: policy_define.o:(.bss+0x28): multiple definition of `te_assertions'; y.tab.o:(.bss+0x18): first defined here
 | collect2: error: ld returned 1 exit status
 | make: *** [Makefile:33: checkpolicy] Error 1
---
 ...ckpolicy-remove-unused-te_assertions.patch | 45 +++++++++++++++++++
 recipes-security/selinux/checkpolicy_3.0.bb   |  4 ++
 2 files changed, 49 insertions(+)
 create mode 100644 recipes-security/selinux/checkpolicy/0001-checkpolicy-remove-unused-te_assertions.patch
recipes-security/selinux/checkpolicy/0001-checkpolicy-remove-unused-te_assertions.patch new file +45 -0
new file mode 100644
index 0000000..61c301e
@@ -0,0 +1,45 @@
+From 95d8f16ece96829109eb75a605b1459a25b5a6be Mon Sep 17 00:00:00 2001
+From: Ondrej Mosnacek <[email protected]>
+Date: Thu, 23 Jan 2020 13:57:15 +0100
+Subject: [PATCH] checkpolicy: remove unused te_assertions
+
+This variable is declared in a header file, but never defined or used.
+The te_assert structure definition is only used in this declaration, so
+remove both.
+
+Upstream-Status: Backport [https://github.com/SELinuxProject/selinux/commit/4d330d0d3155211f119b3082f728ae42dcc01e96]
+
+Signed-off-by: Ondrej Mosnacek <[email protected]>
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ checkpolicy/checkpolicy.h | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/checkpolicy.h b/checkpolicy.h
+index 3868f1fa023b..f127687e72a6 100644
+--- a/checkpolicy.h
++++ b/checkpolicy.h
+@@ -1,20 +1,6 @@
+ #ifndef _CHECKPOLICY_H_
+ #define _CHECKPOLICY_H_
+ 
+-#include <sepol/policydb/ebitmap.h>
+-
+-typedef struct te_assert {
+-	ebitmap_t stypes;
+-	ebitmap_t ttypes;
+-	ebitmap_t tclasses;
+-	int self;
+-	sepol_access_vector_t *avp;
+-	unsigned long line;
+-	struct te_assert *next;
+-} te_assert_t;
+-
+-te_assert_t *te_assertions;
+-
+ extern unsigned int policyvers;
+ 
+ #endif
+-- 
+2.24.1
+
recipes-security/selinux/checkpolicy_3.0.bb +4 -0
index 201da68..50d6217 100644
@@ -5,3 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
 
 SRC_URI[md5sum] = "b7c5547b95ce855bcdc10cb8adba8223"
 SRC_URI[sha256sum] = "c88c719a141dd5c1202d49c378c7f063349d630522d5e04dc6e0c53da81aa4f8"
+
+SRC_URI += "\
+       file://0001-checkpolicy-remove-unused-te_assertions.patch \
+"
Signature · 1 line
2.24.1