Skip to content

Conversation

@lsm5
Copy link
Member

@lsm5 lsm5 commented Dec 17, 2025

OCP clusters upgraded from 4.17/4.18 to 4.20 get AVC denials for pasta operations in nested container mode.

Fixes: RHEL-131796

Summary by Sourcery

Bug Fixes:

  • Resolve SELinux AVC denials when performing pasta networking operations in nested container mode after upgrading OCP clusters from 4.17/4.18 to 4.20.

OCP clusters upgraded from 4.17/4.18 to 4.20 get AVC denials for pasta
operations in nested container mode.

Fixes: RHEL-131796

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 17, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Update SELinux policy for container_engine_t to allow TUN/TAP device access, resolving AVC denials for pasta operations in nested container mode after OCP upgrades to 4.20.

File-Level Changes

Change Details Files
Adjust SELinux policy for container_engine_t to permit TUN/TAP device usage needed by pasta in nested container setups.
  • Modify container.te to extend container_engine_t permissions to cover TUN/TAP device access (e.g., character device operations and related interfaces)
  • Align policy changes with pasta’s usage patterns to eliminate AVC denials seen after upgrading OCP clusters to 4.20
container.te

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gemini-code-assist
Copy link

Summary of Changes

Hello @lsm5, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue in upgraded OCP clusters where pasta operations in nested container environments were failing due to SELinux AVC denials. By modifying the SELinux policy to allow the container engine to access TUN/TAP devices, the change ensures seamless network functionality for containers, preventing service disruptions and improving system stability.

Highlights

  • SELinux Policy Update: The SELinux policy for container_engine_t has been updated to explicitly grant read and write access to TUN/TAP devices.
  • AVC Denial Resolution: This change resolves AVC (Access Vector Cache) denials encountered during pasta operations in nested container mode on OpenShift Container Platform (OCP) clusters upgraded to versions 4.20 from 4.17/4.18.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@lsm5
Copy link
Member Author

lsm5 commented Dec 17, 2025

@rhatdan @haircommander @cgruver PTAL

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a SELinux rule to allow the container_engine_t domain to access TUN/TAP devices. The change, which involves adding the corenet_rw_tun_tap_dev macro call, is a direct and appropriate fix for the described AVC denials related to pasta operations in nested container mode. The new rule is correctly placed within the existing policy structure for container_engine_t. The change is sound and I have no further recommendations.

@haircommander
Copy link
Collaborator

LGTM

@packit-as-a-service
Copy link

Tests failed. @containers/packit-build please check.

@lsm5 lsm5 marked this pull request as ready for review December 18, 2025 19:15
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@lsm5
Copy link
Member Author

lsm5 commented Dec 18, 2025

The AVC denials on ELN and rawhide aarch64 seem to be selinux-policy related. Failing on #430 as well.

@lsm5 lsm5 marked this pull request as draft December 18, 2025 19:16
@lsm5
Copy link
Member Author

lsm5 commented Dec 18, 2025

I think we can merge this once we have final confirmation from @cgruver

@lsm5 lsm5 marked this pull request as ready for review December 18, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants