Jira (PUP-10161) Bundled ruby selinux module seems broken in 6.11 on CentOS 8

10 views
Skip to first unread message

Jarkko Oranen (JIRA)

unread,
Dec 5, 2019, 12:23:04 PM12/5/19
to puppe...@googlegroups.com
Jarkko Oranen created an issue
 
Puppet / Bug PUP-10161
Bundled ruby selinux module seems broken in 6.11 on CentOS 8
Issue Type: Bug Bug
Affects Versions: PUP 6.11.1
Assignee: Unassigned
Created: 2019/12/05 9:22 AM
Priority: Normal Normal
Reporter: Jarkko Oranen

Puppet Version: 6.11.1
Puppet Server Version: N/A (agent only)
OS Name/Version: CentOS 8

Install puppet-agent 6.11.1 on CentOS 8.

Desired Behavior:

From 6.10.1:

# /opt/puppetlabs/puppet/bin/irb 
irb(main):001:0> require 'selinux'
=> true 

Actual Behavior:

With 6.11.1

 # /opt/puppetlabs/puppet/bin/irb 
irb(main):001:0> require 'selinux'
Traceback (most recent call last):
        4: from /opt/puppetlabs/puppet/bin/irb:11:in `<main>'
        3: from (irb):1
        2: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        1: from /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
LoadError (/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.5.0/x86_64-linux/selinux.so: undefined symbol: rpm_execcon - /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/2.5.0/x86_64-linux/selinux.so)

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Jarkko Oranen (JIRA)

unread,
Dec 5, 2019, 12:24:04 PM12/5/19
to puppe...@googlegroups.com
Jarkko Oranen commented on Bug PUP-10161
 
Re: Bundled ruby selinux module seems broken in 6.11 on CentOS 8

Can't reproduce this on CentOS 7, so it seems CentOS 8 specific. This affects the puppet/selinux module

Jarkko Oranen (JIRA)

unread,
Dec 5, 2019, 12:32:05 PM12/5/19
to puppe...@googlegroups.com

The package version that I reproduced this problem with is  puppet-agent-6.11.1-1.el8.x86_64

Rob Braden (JIRA)

unread,
Dec 5, 2019, 2:59:04 PM12/5/19
to puppe...@googlegroups.com

Alexander Fisher (JIRA)

unread,
Dec 6, 2019, 5:03:03 AM12/6/19
to puppe...@googlegroups.com
Alexander Fisher commented on Bug PUP-10161
 
Re: Bundled ruby selinux module seems broken in 6.11 on CentOS 8

We had quite a long discussion both on IRC and slack where we think we understand what's gone wrong. I'll try to capture the relevant bits in this ticket.

It would appear that the selinux ruby bindings have been compiled against libselinux from RHEL 8.1.
libselinux is compiled with

export DISABLE_RPM="n"

whereas in 8.0 is was compiled with

export DISABLE_RPM="y"

See https://git.centos.org/rpms/libselinux/c/29ef3f732b5b513cd8e11a5f02f5498837565688?branch=c8#_11

Trevor Vaughan notes on slack

you always have to build the SELinux materials against the oldest version of EL available

Enhancements to SELinux policies are backwards compatible but later versions may/will break things

and backs this up with evidence this was also an issue in EL7.
https://github.com/simp/simp-core/blob/master/spec/acceptance/suites/rpm_docker/nodesets/el7.yml#L8

Jarkko Oranen Originally reported this against the puppet/selinux module as this does an explicit `require selinux` and explodes.
But actually all of selinux support is broken in Centos 8 (where 8.1 isn't out yet) with the puppet agent 6.11.1 package.
This simple test case doesn't work.

puppet apply -e 'file {"/opt/testfile": ensure => "present", seltype => "default_t" }'

and produces the following debug

Debug: /Stage[main]/Main/File[/opt/testfile]/seltype: SELinux bindings not found. Ignoring parameter.

We think that when core puppet checks for the existence of selinux it must be handling/hiding the load-error and treating it the same way as if the library didn't exist at all.

Josh Cooper (JIRA)

unread,
Dec 6, 2019, 4:07:04 PM12/6/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10161

We think that when core puppet checks for the existence of selinux it must be handling/hiding the load-error and treating it the same way as if the library didn't exist at all.

That is correct. The call to Puppet.features.selinux? will attempt to load the ruby bindings, which will try to load the native library. If that fails, puppet assumes the feature is missing (at least for now). It may become available later during the agent run. When that happens puppet will not attempt to manage any resource or property that is conditional on the selinux feature.

Reply all
Reply to author
Forward
0 new messages