RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1699249 - File /run/xtables.lock gets created with wrong var_run_t context
Summary: File /run/xtables.lock gets created with wrong var_run_t context
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 7.8
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1711916
TreeView+ depends on / blocked
 
Reported: 2019-04-12 08:30 UTC by Renaud Métrich
Modified: 2023-09-07 19:54 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.13.1-253.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-31 19:10:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1007 0 None None None 2020-03-31 19:11:04 UTC

Description Renaud Métrich 2019-04-12 08:30:07 UTC
Description of problem:

When iptables gets executed through cloud-init.service, the /run/xtables.lock file gets created with context "var_run_t" instead of "iptables_var_run_t".

This is due to not having the proper transition in the policy, the following is missing:

type_transition cloud_init_t var_run_t:file iptables_var_run_t "xtables.lock"; 


Version-Release number of selected component (if applicable):

selinux-policy-3.13.1-229.el7_6.9.noarch


How reproducible:

Always


Steps to Reproduce:
1. Create a fake cloud-init service calling iptables internally

# cat > /usr/local/bin/cloud-init << EOF
#!/bin/bash
iptables -F
EOF

# chmod +x /usr/local/bin/cloud-init
# chcon -t cloud_init_exec_t /usr/local/bin/cloud-init

# cat > /etc/systemd/system/cloud-init.service << EOF
[Service]
Type=oneshot
ExecStart=/usr/local/bin/cloud-init
EOF

2. Execute the service

# /bin/rm /run/xtables.lock || true
# systemctl daemon-reload
# systemctl start cloud-init

3. Check the context

# ls -Z /run/xtables.lock

Actual results:

-rw-------. root root system_u:object_r:var_run_t:s0   /run/xtables.lock


Expected results:

-rw-------. root root system_u:object_r:iptables_var_run_t:s0   /run/xtables.lock


Additional info:

This is already fixed in RHEL8.0, through adding a transition rule for a very large number of process contexts, including "cloud_init_t".

Comment 10 errata-xmlrpc 2020-03-31 19:10:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1007


Note You need to log in before you can comment on or make changes to this bug.