Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

(PA-5632) Update SELinux on Red Hat 9 to 3.3 #737

Merged

Conversation

mhashizume
Copy link
Contributor

Prior to this commit, there was a discrepancy between the versions of SELinux we built our Red Hat Enterprise Linux (RHEL) 9 runtimes on and the minimum version available on the OS (SELinux 3.3).

This commit builds RHEL 9 runtimes with version 3.3 of SELinux to resolve that discrepancy.

@mhashizume mhashizume force-pushed the PA-5632/master/rhel9-selinux branch from d423169 to 249b0bd Compare October 10, 2023 21:14
@@ -57,6 +68,11 @@
steps << "#{platform.patch} --strip=0 --fuzz=0 --ignore-whitespace --no-backup-if-mismatch < ../selinuxswig_ruby_wrap.patch"
end

# libselinux 3.3 is the minimum version we want to build on RHEL 9, but the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tried using versions 3.4 or 3.5? I'm fine merging this as is, but, if we could just use a later version of selinux, maybe we can avoid this hack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried it, my assumption was that there would be compatibility issues if there were a discrepancy between the bindings we built and the version running on the system. Do you think it would be worth a shot?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not sure if there would be a discrepancy, seems like it might possibly work? As long as the major versions are the same...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using the SELinux 3.4 tarball and installing the libselinux-devel-3.4 package. It seems like it creates the same compatibility issue as we saw in the original ticket. On an adhoc agent build on x86_64:

Begin tests/selinux.rb

PA-3067: Manage selinux

  * test require 'selinux'

  ergotropic-trap.delivery.puppetlabs.net (ergotropic-trap.delivery.puppetlabs.net) 23:22:11$ env PATH="/opt/puppetlabs/puppet/bin:${PATH}" ruby -e 'require "selinux"'
 /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:86:in `require': /lib64/libselinux.so.1: version `LIBSELINUX_3.4' not found (required by /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/selinux.so) - /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.7.0/x86_64-linux/selinux.so (LoadError)
    	from /opt/puppetlabs/puppet/lib/ruby/site_ruby/2.7.0/rubygems/core_ext/kernel_require.rb:86:in `require'
    	from -e:1:in `<main>'

I assume this happens because there's a mismatch between what we build against and what's present on the system.

I think the only way we can avoid this issue is to target the lowest common denominator, SELinux 3.3.

Prior to this commit, there was a discrepancy between the versions of
SELinux we built our Red Hat Enterprise Linux (RHEL) 9 runtimes on and
the minimum version available on the OS (SELinux 3.3).

This commit builds RHEL 9 runtimes with version 3.3 of SELinux to
resolve that discrepancy.
@mhashizume mhashizume force-pushed the PA-5632/master/rhel9-selinux branch from 249b0bd to 0228a1a Compare October 25, 2023 16:41
@mhashizume mhashizume marked this pull request as ready for review October 25, 2023 16:41
@mhashizume mhashizume requested review from a team as code owners October 25, 2023 16:41
@tvpartytonight tvpartytonight merged commit 469a97b into puppetlabs:master Nov 1, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants