USHIFT-7240: work around kernel 7.x SELinux execmem denial on EL10 bootc#6903
Conversation
Add allow rule to the microshift SELinux policy module so that CRI-O can perform text relocations when running as kernel_t on composefs. This is needed until the RHEL 10.2 kernel backports the upstream fix (880bd496ec72, 6af36aeb147a, 82544d36b172). USHIFT-7215 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@eslutsky: This pull request references USHIFT-7240 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughAdds ChangesSELinux kernel 7.x execmem workaround
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 10❌ Failed checks (10 inconclusive)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
pacevedom
left a comment
There was a problem hiding this comment.
Adds a temporary SELinux CIL policy module + systemd oneshot service to the EL10 base containerfile (rhel102-test-agent), unblocking all EL10 bootc CI jobs is not true anymore, right?
This also applies to el9, where the bug is not present, right?
|
/override ci/prow/e2e-aws-tests |
|
@eslutsky: Overrode contexts on behalf of eslutsky: ci/prow/e2e-aws-tests, ci/prow/e2e-aws-tests-arm DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@eslutsky: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: eslutsky, pacevedom The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified by CI |
|
@pacevedom: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/cherrypick release-4.22 |
|
@eslutsky: new pull request created: #6910 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
mprotect()checks on composefs/overlayfs evaluate the backing file's context instead of the overlay file's contextkernel_tinstead ofcontainer_runtime_t, which denies theexecmempermission needed for text relocations (CGO libgpgme binding)Root cause
Kernel 7.0 has a regression in LSM/overlayfs where
mprotect()access checks evaluate the backing file's security context instead of the overlay file's context. On composefs (used by bootc), this prevents SELinux domain transitions — CRI-O stays askernel_tinstead of transitioning tocontainer_runtime_t.Upstream fix
3-commit series by Paul Moore, landed in v7.1-rc1 (not yet backported to RHEL 10.2 kernel):
880bd496ec72— fs: prepare for adding LSM blob to backing_file6af36aeb147a— lsm: add backing_file LSM hooks82544d36b172— selinux: fix overlayfs mmap() and mprotect() access checksRemove this workaround** once the upstream kernel fix is backported to the RHEL 10.2 kernel.
References
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit