Skip to contentSkip to conversation

libsepol: drop support for policy versions before xperms_ioctl/xen_devicetree

PATCH In review Stephen Smalley 4 participants 8 messages Aug 27 – Sep 7 SELinux security module

lore
Share & tools
lore

Stephen Smalley

author maintainer
#0 lore raw

PATCH v5 1/1 libsepol: drop support for policy versions before xperms_ioctl/xen_devicetree

Drop support for kernel and module policy versions before the xperms_ioctl support (SELinux kernel policy version 30, modular policy version 18) and xen_devicetree support (Xen policy version 30). Kernel policy version 30 was first supported in Linux v4.3, Xen 4.6, and libsepol 2.5 (20160223). Modular policy version 18 was first supported in libsepol 2.7 (20170804).

RHEL >= 8, Debian >= 10, Ubuntu >= 18.04, and SUSE/SLES >= 15 have libsepol >= 2.7+.

---
v5 fixes a build break on older clang versions in ocontext_read_xen() and ocontext_write_xen(), drops the no-longer-necessary passing of the policydb pointer to range_write_helper(), and drops RFC from the submission.

 README.md                                  |  27 +-
 checkpolicy/fuzz/checkpolicy-fuzzer.c      |   3 +-
 libsepol/cil/src/cil_binary.c              |  31 +--
 libsepol/include/sepol/policydb/avtab.h    |   4 +-
 libsepol/include/sepol/policydb/policydb.h |  19 +-
 libsepol/src/avtab.c                       |  15 +-
 libsepol/src/conditional.c                 |  10 +-
 libsepol/src/policydb.c                    | 279 +++------------------
 libsepol/src/policydb_validate.c           |  10 +-
 libsepol/src/services.c                    |  10 +-
 libsepol/src/write.c                       | 251 ++++--------------
 11 files changed, 117 insertions(+), 542 deletions(-)
README.md +13 -14
index 3069e1a5..a02a0a4d 100644
@@ -25,9 +25,8 @@ for more information.
 
 Minimum Supported Kernel Version
 --------------------------------
-The minimum supported kernel version is Linux v3.0 (for the
-/sys/fs/selinux mount point directory) for libselinux and anything
-that uses libselinux to access selinuxfs.
+The minimum supported kernel version is Linux v4.3 to match the
+minimum supported kernel policy version by libsepol.
 
 Note that the policy build toolchain (e.g. libsepol, checkpolicy,
 checkmodule, secilc, semodule_package/expand/link) does not link with
@@ -38,16 +37,16 @@ successfully been built and run on non-Linux platforms as well
 
 Minimum Supported Policy Versions
 ---------------------------------
-The minimum kernel policy version is 24 (boundary) for the SELinux and
-Xen targets. Support for this policy version first shipped in libsepol
-2.0.34 (userspace release 20090403), Linux v2.6.28, and Xen
-4.0.0. libsepol dropped support for kernel policy versions older than
-24 starting with libsepol 3.12.
+The minimum kernel policy version is 30 (xperms_ioctl for SELinux,
+xen_devicetree for Xen). Support for this policy version first shipped
+in libsepol 2.5 (userspace release 20160223), Linux v4.3, and Xen
+4.6. libsepol dropped support for kernel policy versions older than 30
+starting with libsepol 3.12.
 
-The minimum modular policy version is 10 (boundary alias). Support for
-this modular policy version first shipped in libsepol 2.0.35
-(userspace release 20090403). libsepol dropped support for modular
-policies older than 10 starting with libsepol 3.12
+The minimum modular policy version is 18 (xperms_ioctl). Support for
+this modular policy version first shipped in libsepol 2.7 (userspace
+release 20170804). libsepol dropped support for modular policies older
+than 18 starting with libsepol 3.12.
 
 These minimum policy versions in libsepol affect:
 1. The policy build toolchain. For example, checkpolicy, checkmodule,
@@ -60,8 +59,8 @@ the minimum.
 3. SELinux policy analysis tools. For example, setools cannot read a
 policy with a version less the minimum.
 4. The Xen hypervisor, which compiles its XSM/Flask policies using
-checkpolicy, and only currently supports kernel policy versions 24 and
-30 for the Xen target. Xen does not use binary policy modules so it is
+checkpolicy, and only currently supports kernel policy version 30 for
+the Xen target. Xen does not use binary policy modules so it is
 unaffected by changes to the minimum modular policy version.
 5. Android, which is on kernel policy version 30. There has not been
 any need for newer policy version features yet. Android does not use
checkpolicy/fuzz/checkpolicy-fuzzer.c +1 -2
index 401f24e3..ccbcfa7a 100644
@@ -187,8 +187,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
 	    policyvers > POLICYDB_VERSION_MAX)
 		return 0;
 	if (platform == SEPOL_TARGET_XEN &&
-	    policyvers != POLICYDB_VERSION_XEN_DEVICETREE &&
-	    policyvers != POLICYDB_VERSION_BOUNDARY)
+	    policyvers != POLICYDB_VERSION_XEN_DEVICETREE)
 		return 0;
 	data += 3;
 	size -= 3;
libsepol/cil/src/cil_binary.c +13 -18
index e99405b4..60b4db4d 100644
@@ -3189,28 +3189,23 @@ static int __cil_constrain_expr_datum_to_sepol_expr(policydb_t *pdb,
 		ebitmap_node_t *tnode;
 		unsigned int i;
 
-		if (pdb->policyvers >= POLICYDB_VERSION_CONSTRAINT_NAMES) {
-			rc = __cil_get_sepol_type_datum(pdb, item->data,
-							&sepol_type);
-			if (rc != SEPOL_OK) {
-				if (FLAVOR(item->data) == CIL_TYPEATTRIBUTE) {
-					struct cil_typeattribute *attr =
-						item->data;
-					if (!attr->keep) {
-						rc = 0;
-					}
+		rc = __cil_get_sepol_type_datum(pdb, item->data, &sepol_type);
+		if (rc != SEPOL_OK) {
+			if (FLAVOR(item->data) == CIL_TYPEATTRIBUTE) {
+				struct cil_typeattribute *attr = item->data;
+				if (!attr->keep) {
+					rc = 0;
 				}
 			}
+		}
 
-			if (sepol_type) {
-				rc = ebitmap_set_bit(&expr->type_names->types,
-						     sepol_type->s.value - 1,
-						     1);
-			}
+		if (sepol_type) {
+			rc = ebitmap_set_bit(&expr->type_names->types,
+					     sepol_type->s.value - 1, 1);
+		}
 
-			if (rc != SEPOL_OK) {
-				goto exit;
-			}
+		if (rc != SEPOL_OK) {
+			goto exit;
 		}
 
 		rc = __cil_expand_type(item->data, &type_bitmap);
libsepol/include/sepol/policydb/avtab.h +2 -2
index fe90e45e..83e1033f 100644
@@ -121,12 +121,12 @@ extern int avtab_map(const avtab_t *h,
 extern void avtab_hash_eval(avtab_t *h, char *tag);
 
 struct policy_file;
-extern int avtab_read_item(struct policy_file *fp, uint32_t vers, avtab_t *a,
+extern int avtab_read_item(struct policy_file *fp, avtab_t *a,
 			   int (*insert)(avtab_t *a, avtab_key_t *k,
 					 avtab_datum_t *d, void *p),
 			   void *p);
 
-extern int avtab_read(avtab_t *a, struct policy_file *fp, uint32_t vers);
+extern int avtab_read(avtab_t *a, struct policy_file *fp);
 
 extern avtab_ptr_t avtab_insert_nonunique(avtab_t *h, avtab_key_t *key,
 					  avtab_datum_t *datum);
libsepol/include/sepol/policydb/policydb.h +2 -17
index 8390874d..03831fc2 100644
@@ -195,7 +195,6 @@ typedef struct type_datum {
 
 /*
  * Properties of type_datum
- * available on the policy version >= (MOD_)POLICYDB_VERSION_BOUNDARY
  */
 #define TYPEDATUM_PROPERTY_PRIMARY 0x0001
 #define TYPEDATUM_PROPERTY_ATTRIBUTE 0x0002
@@ -752,12 +751,6 @@ extern int policydb_set_target_platform(policydb_t *p, int platform);
 #define PERM_SYMTAB_SIZE 32
 
 /* Identify specific policy version changes */
-#define POLICYDB_VERSION_BOUNDARY 24
-#define POLICYDB_VERSION_FILENAME_TRANS 25
-#define POLICYDB_VERSION_ROLETRANS 26
-#define POLICYDB_VERSION_NEW_OBJECT_DEFAULTS 27
-#define POLICYDB_VERSION_DEFAULT_TYPE 28
-#define POLICYDB_VERSION_CONSTRAINT_NAMES 29
 #define POLICYDB_VERSION_XEN_DEVICETREE 30 /* Xen-specific */
 #define POLICYDB_VERSION_XPERMS_IOCTL 30 /* Linux-specific */
 #define POLICYDB_VERSION_INFINIBAND 31 /* Linux-specific */
@@ -768,18 +761,10 @@ extern int policydb_set_target_platform(policydb_t *p, int platform);
 #define POLICYDB_VERSION_NEVERAUDIT 35 /* neveraudit domains */
 
 /* Range of policy versions we understand*/
-#define POLICYDB_VERSION_MIN POLICYDB_VERSION_BOUNDARY
+#define POLICYDB_VERSION_MIN POLICYDB_VERSION_XPERMS_IOCTL
 #define POLICYDB_VERSION_MAX POLICYDB_VERSION_NEVERAUDIT
 
 /* Module versions and specific changes*/
-#define MOD_POLICYDB_VERSION_BOUNDARY_ALIAS 10
-#define MOD_POLICYDB_VERSION_FILENAME_TRANS 11
-#define MOD_POLICYDB_VERSION_ROLETRANS 12
-#define MOD_POLICYDB_VERSION_ROLEATTRIB 13
-#define MOD_POLICYDB_VERSION_TUNABLE_SEP 14
-#define MOD_POLICYDB_VERSION_NEW_OBJECT_DEFAULTS 15
-#define MOD_POLICYDB_VERSION_DEFAULT_TYPE 16
-#define MOD_POLICYDB_VERSION_CONSTRAINT_NAMES 17
 #define MOD_POLICYDB_VERSION_XPERMS_IOCTL 18
 #define MOD_POLICYDB_VERSION_INFINIBAND 19
 #define MOD_POLICYDB_VERSION_GLBLUB 20
@@ -788,7 +773,7 @@ extern int policydb_set_target_platform(policydb_t *p, int platform);
 #define MOD_POLICYDB_VERSION_NEVERAUDIT 23
 #define MOD_POLICYDB_VERSION_TYPE_ATTR_ATTRS 24
 
-#define MOD_POLICYDB_VERSION_MIN MOD_POLICYDB_VERSION_BOUNDARY_ALIAS
+#define MOD_POLICYDB_VERSION_MIN MOD_POLICYDB_VERSION_XPERMS_IOCTL
 #define MOD_POLICYDB_VERSION_MAX MOD_POLICYDB_VERSION_TYPE_ATTR_ATTRS
 
 #define POLICYDB_CONFIG_MLS 1
libsepol/src/avtab.c +4 -11
index 2bb67599..bb3893aa 100644
@@ -417,7 +417,7 @@ void avtab_hash_eval(avtab_t *h, char *tag)
 	       tag, h->nel, slots_used, h->nslot, max_chain_len);
 }
 
-int avtab_read_item(struct policy_file *fp, uint32_t vers, avtab_t *a,
+int avtab_read_item(struct policy_file *fp, avtab_t *a,
 		    int (*insertf)(avtab_t *a, avtab_key_t *k, avtab_datum_t *d,
 				   void *p),
 		    void *p)
@@ -457,14 +457,7 @@ int avtab_read_item(struct policy_file *fp, uint32_t vers, avtab_t *a,
 		return -1;
 	}
 
-	if ((vers < POLICYDB_VERSION_XPERMS_IOCTL) &&
-	    (key.specified & AVTAB_XPERMS)) {
-		ERR(fp->handle,
-		    "policy version %u does not support extended "
-		    "permissions rules and one was specified",
-		    vers);
-		return -1;
-	} else if (key.specified & AVTAB_XPERMS) {
+	if (key.specified & AVTAB_XPERMS) {
 		rc = next_entry(&buf8, fp, sizeof(uint8_t));
 		if (rc < 0) {
 			ERR(fp->handle, "truncated entry");
@@ -502,7 +495,7 @@ static int avtab_insertf(avtab_t *a, avtab_key_t *k, avtab_datum_t *d,
 	return avtab_insert(a, k, d);
 }
 
-int avtab_read(avtab_t *a, struct policy_file *fp, uint32_t vers)
+int avtab_read(avtab_t *a, struct policy_file *fp)
 {
 	unsigned int i;
 	int rc;
@@ -528,7 +521,7 @@ int avtab_read(avtab_t *a, struct policy_file *fp, uint32_t vers)
 	}
 
 	for (i = 0; i < nel; i++) {
-		rc = avtab_read_item(fp, vers, a, avtab_insertf, NULL);
+		rc = avtab_read_item(fp, a, avtab_insertf, NULL);
 		if (rc) {
 			if (rc == SEPOL_ENOMEM)
 				ERR(fp->handle, "out of memory");
libsepol/src/conditional.c +4 -6
index a8070a6a..283ffe27 100644
@@ -592,8 +592,7 @@ int cond_read_bool(policydb_t *p, hashtab_t h, struct policy_file *fp)
 	if (str_read(&key, fp, len))
 		goto err;
 
-	if (p->policy_type != POLICY_KERN &&
-	    p->policyvers >= MOD_POLICYDB_VERSION_TUNABLE_SEP) {
+	if (p->policy_type != POLICY_KERN) {
 		rc = next_entry(buf, fp, sizeof(uint32_t));
 		if (rc < 0)
 			goto err;
@@ -721,8 +720,8 @@ static int cond_read_av_list(policydb_t *p, void *fp, cond_av_list_t **ret_list,
 	data.head = NULL;
 	data.tail = NULL;
 	for (i = 0; i < len; i++) {
-		rc = avtab_read_item(fp, p->policyvers, &p->te_cond_avtab,
-				     cond_insertf, &data);
+		rc = avtab_read_item(fp, &p->te_cond_avtab, cond_insertf,
+				     &data);
 		if (rc) {
 			cond_av_list_destroy(data.head);
 			return rc;
@@ -808,8 +807,7 @@ static int cond_read_node(policydb_t *p, cond_node_t *node, void *fp)
 			goto err;
 	}
 
-	if (p->policy_type != POLICY_KERN &&
-	    p->policyvers >= MOD_POLICYDB_VERSION_TUNABLE_SEP) {
+	if (p->policy_type != POLICY_KERN) {
 		rc = next_entry(buf, fp, sizeof(uint32_t));
 		if (rc < 0)
 			goto err;
libsepol/src/policydb.c +30 -249

418 lines not on this page · raw message

libsepol/src/policydb_validate.c +2 -8
index fe8bf1cf..4d7983d5 100644
@@ -1586,11 +1586,6 @@ static int validate_ocontexts(sepol_handle_t *handle, const policydb_t *p,
 					if (octx->u.iomem.low_iomem >
 					    octx->u.iomem.high_iomem)
 						goto bad;
-					if (p->policyvers <
-						    POLICYDB_VERSION_XEN_DEVICETREE &&
-					    octx->u.iomem.high_iomem >
-						    0xFFFFFFFFULL)
-						goto bad;
 					break;
 				case OCON_XEN_DEVICETREE:
 					if (validate_string_field(octx->u.name))
@@ -2088,9 +2083,8 @@ int policydb_validate(sepol_handle_t *handle, const policydb_t *p)
 			goto bad;
 		if (validate_role_allows(handle, p->role_allow, flavors))
 			goto bad;
-		if (p->policyvers >= POLICYDB_VERSION_FILENAME_TRANS)
-			if (validate_filename_trans_hashtab(handle, p, flavors))
-				goto bad;
+		if (validate_filename_trans_hashtab(handle, p, flavors))
+			goto bad;
 	} else {
 		if ((p->policy_type == POLICY_MOD) && (p->p_commons.nprim > 0))
 			goto bad;
libsepol/src/services.c +3 -7
index 3e8bd38b..fdd84078 100644
@@ -202,12 +202,10 @@ static void cat_expr_buf(char *e_buf, const char *string)
 }
 
 /*
- * If the POLICY_KERN version is >= POLICYDB_VERSION_CONSTRAINT_NAMES,
- * then for 'types' only, read the types_names->types list as it will
+ * For 'types' only, read the types_names->types list as it will
  * contain a list of types and attributes that were defined in the
  * policy source.
- * For user and role plus types (for policy vers <
- * POLICYDB_VERSION_CONSTRAINT_NAMES) just read the e->names list.
+ * For user and role just read the e->names list.
  */
 static void get_name_list(constraint_expr_t *e, int type, const char *src,
 			  const char *op, int failed)
@@ -218,9 +216,7 @@ static void get_name_list(constraint_expr_t *e, int type, const char *src,
 	char tmp_buf[128];
 	int counter = 0;
 
-	if (policydb->policy_type == POLICY_KERN &&
-	    policydb->policyvers >= POLICYDB_VERSION_CONSTRAINT_NAMES &&
-	    type == CEXPR_TYPE)
+	if (policydb->policy_type == POLICY_KERN && type == CEXPR_TYPE)
 		types = &e->type_names->types;
 	else
 		types = &e->names;
libsepol/src/write.c +43 -208

443 lines not on this page · raw message

Signature · 1 line
2.55.0
author maintainer
#1 lore raw
Quoted 10 lines · Stephen Smalley

Drop support for kernel and module policy versions before the xperms_ioctl support (SELinux kernel policy version 30, modular policy version 18) and xen_devicetree support (Xen policy version 30). Kernel policy version 30 was first supported in Linux v4.3, Xen 4.6, and libsepol 2.5 (20160223). Modular policy version 18 was first supported in libsepol 2.7 (20170804).

RHEL >= 8, Debian >= 10, Ubuntu >= 18.04, and SUSE/SLES >= 15 have libsepol >= 2.7+.

Would appreciate any feedback from distro package maintainers on how/if this change would
impact them. Link to the original patch for those who weren't cc'd on it:
https://lore.kernel.org/selinux/[email protected]/T/#u

This would break e.g. RHEL 7, Debian 9, Ubuntu 16.04, or SUSE/SLES 12 if they ever updated to a version of libsepol with this change but I think that's unlikely.
The greater risk is if you have any lingering binary modules compiled with versions < 18 inherited across multiple upgrades (e.g. RHEL-7 to RHEL-8), then those modules will break and probably in a not-very-nice way (libsepol suddenly won't be able to parse them and therefore any semodule/semanage operations will fail and you might have to delete them manually from the policy module store).

I'm fine with deferring this change to a future libsepol release after 3.12 (e.g. 3.13 or later) if that would be safer for the distros.

#2 lore raw
Quoted 3 lines · On Tuesday, 1 September 2026 04:01:05 AEST Stephen Smalley wrote:

This would break e.g. RHEL 7, Debian 9, Ubuntu 16.04, or SUSE/SLES 12 if they ever updated to a version of libsepol with this change but I think that's unlikely.

I have no interest in Debian 9. If someone wants to update a Debian 9 system to a current version of libsepol I'm not bothered if it breaks totally.

Quoted 6 lines

The greater risk is if you have any lingering binary modules compiled with versions < 18 inherited across multiple upgrades (e.g. RHEL-7 to RHEL-8), then those modules will break and probably in a not-very-nice way (libsepol suddenly won't be able to parse them and therefore any semodule/semanage operations will fail and you might have to delete them manually from the policy module store).

Binary modules aren't something I'm interested in for Debian. Just don't use modules unless you have the .te file.

Quoted 2 lines

I'm fine with deferring this change to a future libsepol release after 3.12 (e.g. 3.13 or later) if that would be safer for the distros.

I don't think there's a reason to delay.

Also last I checked the current git refpolicy compiled with the recent libsepol etc causes a kernel panic on the Debian 13 kernels. So if we don't get that fixed then the Debian 14 kernel will be required for any sort of new policy.

Signature · 2 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
author maintainer
#3 lore raw
Quoted 22 lines · Russell Coker
Quoted 3 lines · On Tuesday, 1 September 2026 04:01:05 AEST Stephen Smalley wrote:

This would break e.g. RHEL 7, Debian 9, Ubuntu 16.04, or SUSE/SLES 12 if they ever updated to a version of libsepol with this change but I think that's unlikely.

I have no interest in Debian 9. If someone wants to update a Debian 9 system to a current version of libsepol I'm not bothered if it breaks totally.

Quoted 6 lines

The greater risk is if you have any lingering binary modules compiled with versions < 18 inherited across multiple upgrades (e.g. RHEL-7 to RHEL-8), then those modules will break and probably in a not-very-nice way (libsepol suddenly won't be able to parse them and therefore any semodule/semanage operations will fail and you might have to delete them manually from the policy module store).

Binary modules aren't something I'm interested in for Debian. Just don't use modules unless you have the .te file.

Quoted 2 lines

I'm fine with deferring this change to a future libsepol release after 3.12 (e.g. 3.13 or later) if that would be safer for the distros.

Quoted 6 lines

I don't think there's a reason to delay.

Also last I checked the current git refpolicy compiled with the recent libsepol etc causes a kernel panic on the Debian 13 kernels. So if we don't get that fixed then the Debian 14 kernel will be required for any sort of new policy.

Can you provide more details about that please?

#4 lore raw
In reply to Stephen Smalley
Quoted 13 lines · Stephen Smalley
Quoted 10 lines · Stephen Smalley

Drop support for kernel and module policy versions before the xperms_ioctl support (SELinux kernel policy version 30, modular policy version 18) and xen_devicetree support (Xen policy version 30). Kernel policy version 30 was first supported in Linux v4.3, Xen 4.6, and libsepol 2.5 (20160223). Modular policy version 18 was first supported in libsepol 2.7 (20170804).

RHEL >= 8, Debian >= 10, Ubuntu >= 18.04, and SUSE/SLES >= 15 have libsepol >= 2.7+.

Quoted 8 lines

Would appreciate any feedback from distro package maintainers on how/if this change would
impact them. Link to the original patch for those who weren't cc'd on it:
https://lore.kernel.org/selinux/[email protected]/T/#u

This would break e.g. RHEL 7, Debian 9, Ubuntu 16.04, or SUSE/SLES 12 if they ever updated to a version of libsepol with this change but I think that's unlikely.

SLES should be fine:
- SLES 12: version bumps are unlikely, only backporting of patches because everything else is too risky
- SLES 15: everything besides 15.0 has libsepol >2.7 and also unlikely that we bump the libsepol version in 15

Quoted 6 lines

The greater risk is if you have any lingering binary modules compiled with versions < 18 inherited across multiple upgrades (e.g. RHEL-7 to RHEL-8), then those modules will break and probably in a not-very-nice way (libsepol suddenly won't be able to parse them and therefore any semodule/semanage operations will fail and you might have to delete them manually from the policy module store).

We did not support the policy that long, so I think it should be okay:
SLES:
- 12 -> 15 no policy update will happen because in SLES 15 there is no distro policy shipped or supported
- everything else has libsepol >2.7
It might be that 1 person drags their SLE12 policy to 16, but I think that is not a supported use case

SLE Micro:
- started with libsepol >=3.1, so should be fine

But generally our built distro policies are unlikely to be inherited between versions from SLE >=16 + SLE Micro >=6 on, on upgrade it will be migrated to the one that is built for the upgrade target

Quoted 3 lines

I'm fine with deferring this change to a future libsepol release after 3.12 (e.g. 3.13 or later) if that would be safer for the distros.

I don't think it is necessary to delay from our side, thanks for the notification.

Let me know in case I am misunderstanding something, thanks!

author maintainer
#5 lore raw
Quoted 47 lines · Cathy Hu
Quoted 13 lines · Stephen Smalley
Quoted 10 lines · Stephen Smalley

Drop support for kernel and module policy versions before the xperms_ioctl support (SELinux kernel policy version 30, modular policy version 18) and xen_devicetree support (Xen policy version 30). Kernel policy version 30 was first supported in Linux v4.3, Xen 4.6, and libsepol 2.5 (20160223). Modular policy version 18 was first supported in libsepol 2.7 (20170804).

RHEL >= 8, Debian >= 10, Ubuntu >= 18.04, and SUSE/SLES >= 15 have libsepol >= 2.7+.

Quoted 8 lines

Would appreciate any feedback from distro package maintainers on how/if this change would
impact them. Link to the original patch for those who weren't cc'd on it:
https://lore.kernel.org/selinux/[email protected]/T/#u

This would break e.g. RHEL 7, Debian 9, Ubuntu 16.04, or SUSE/SLES 12 if they ever updated to a version of libsepol with this change but I think that's unlikely.

SLES should be fine:
- SLES 12: version bumps are unlikely, only backporting of patches because everything else is too risky
- SLES 15: everything besides 15.0 has libsepol >2.7 and also unlikely that we bump the libsepol version in 15

Quoted 6 lines

The greater risk is if you have any lingering binary modules compiled with versions < 18 inherited across multiple upgrades (e.g. RHEL-7 to RHEL-8), then those modules will break and probably in a not-very-nice way (libsepol suddenly won't be able to parse them and therefore any semodule/semanage operations will fail and you might have to delete them manually from the policy module store).

We did not support the policy that long, so I think it should be okay:
SLES:
- 12 -> 15 no policy update will happen because in SLES 15 there is no distro policy shipped or supported
- everything else has libsepol >2.7
It might be that 1 person drags their SLE12 policy to 16, but I think that is not a supported use case

SLE Micro:
- started with libsepol >=3.1, so should be fine

But generally our built distro policies are unlikely to be inherited between versions from SLE >=16 + SLE Micro >=6 on, on upgrade it will be migrated to the one that is built for the upgrade target

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

I'm fine with deferring this change to a future libsepol release after 3.12 (e.g. 3.13 or later) if that would be safer for the distros.

I don't think it is necessary to delay from our side, thanks for the notification.

Let me know in case I am misunderstanding something, thanks!

Having heard no objections, I plan to re-base and merge this today.

author maintainer
#6 lore raw
Quoted 49 lines · Stephen Smalley
Quoted 47 lines · Cathy Hu
Quoted 13 lines · Stephen Smalley
Quoted 10 lines · Stephen Smalley

Drop support for kernel and module policy versions before the xperms_ioctl support (SELinux kernel policy version 30, modular policy version 18) and xen_devicetree support (Xen policy version 30). Kernel policy version 30 was first supported in Linux v4.3, Xen 4.6, and libsepol 2.5 (20160223). Modular policy version 18 was first supported in libsepol 2.7 (20170804).

RHEL >= 8, Debian >= 10, Ubuntu >= 18.04, and SUSE/SLES >= 15 have libsepol >= 2.7+.

Quoted 8 lines

Would appreciate any feedback from distro package maintainers on how/if this change would
impact them. Link to the original patch for those who weren't cc'd on it:
https://lore.kernel.org/selinux/[email protected]/T/#u

This would break e.g. RHEL 7, Debian 9, Ubuntu 16.04, or SUSE/SLES 12 if they ever updated to a version of libsepol with this change but I think that's unlikely.

SLES should be fine:
- SLES 12: version bumps are unlikely, only backporting of patches because everything else is too risky
- SLES 15: everything besides 15.0 has libsepol >2.7 and also unlikely that we bump the libsepol version in 15

Quoted 6 lines

The greater risk is if you have any lingering binary modules compiled with versions < 18 inherited across multiple upgrades (e.g. RHEL-7 to RHEL-8), then those modules will break and probably in a not-very-nice way (libsepol suddenly won't be able to parse them and therefore any semodule/semanage operations will fail and you might have to delete them manually from the policy module store).

We did not support the policy that long, so I think it should be okay:
SLES:
- 12 -> 15 no policy update will happen because in SLES 15 there is no distro policy shipped or supported
- everything else has libsepol >2.7
It might be that 1 person drags their SLE12 policy to 16, but I think that is not a supported use case

SLE Micro:
- started with libsepol >=3.1, so should be fine

But generally our built distro policies are unlikely to be inherited between versions from SLE >=16 + SLE Micro >=6 on, on upgrade it will be migrated to the one that is built for the upgrade target

Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I'm fine with deferring this change to a future libsepol release after 3.12 (e.g. 3.13 or later) if that would be safer for the distros.

I don't think it is necessary to delay from our side, thanks for the notification.

Let me know in case I am misunderstanding something, thanks!

Having heard no objections, I plan to re-base and merge this today.

This is now merged but can be reverted if distros report problems.

#7 lore raw

Hi Stephen,

Quoted 4 lines · Stephen Smalley
Quoted 1 line · Stephen Smalley

Having heard no objections, I plan to re-base and merge this today.

This is now merged but can be reverted if distros report problems.

I was on a (long) holiday, so delayed feedback for me. At least for SUSE this is not a problem since we will never update very old products like SLE 12 to this, so breaking changing of this nature are no problem for us.

Johannes

Signature · 4 lines
GPG Key                EE16 6BCE AD56 E034 BFB3  3ADD 7BF7 29D5 E7C8 1FA0
Subkey fingerprint:    250F 43F5 F7CE 6F1E 9C59  4F95 BC27 DD9D 2CC4 FD66
SUSE Software Solutions Germany GmbH, Frankenstr. 146, 90461 Nürnberg, Germany
www.suse.com, Geschäftsführer: Jochen Jaser, Andrew McDonald, Abhinav Puri, (HRB 36809, AG Nürnberg)