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 2173604 - SELinux prevents the chronyc process from searching in the /proc/sys/net/ipv6/conf/all/ directory
Summary: SELinux prevents the chronyc process from searching in the /proc/sys/net/ipv6...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: selinux-policy
Version: 9.2
Hardware: Unspecified
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Nobody
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-27 11:42 UTC by Filip Dvorak
Modified: 2023-11-07 11:22 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-38.1.12-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-07 08:52:17 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1621 0 None open Allow chronyc read network sysctls 2023-03-03 11:44:48 UTC
Red Hat Issue Tracker RHELPLAN-149924 0 None None None 2023-02-27 11:44:02 UTC
Red Hat Product Errata RHBA-2023:6617 0 None None None 2023-11-07 08:52:36 UTC

Description Filip Dvorak 2023-02-27 11:42:42 UTC
Description of problem:
avc:  denied  { search } for  pid=4109 comm="chronyc" name="net"

Version-Release number of selected component (if applicable):
RHEL-9.2.0-20230220.9
selinux-policy-38.1.8-1.el9.noarch


Steps to Reproduce:
1. install RHEL9.2
2. run "chronyc sources"

Actual results:
time->Mon Feb 27 05:50:59 2023
type=PROCTITLE msg=audit(1677495059.158:2403): proctitle=6368726F6E796300736F7572636573
type=SYSCALL msg=audit(1677495059.158:2403): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=7ffd2795cc50 a2=80100 a3=0 items=0 ppid=23107 pid=24158 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4 comm="chronyc" exe="/usr/bin/chronyc" subj=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1677495059.158:2403): avc:  denied  { search } for  pid=24158 comm="chronyc" name="net" dev="proc" ino=13214 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sysctl_net_t:s0 tclass=dir permissive=0

Expected results:
No AVC message

Additional info:

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33
selinux-policy-38.1.8-1.el9.noarch
----
time->Mon Feb 27 05:50:59 2023
type=PROCTITLE msg=audit(1677495059.158:2403): proctitle=6368726F6E796300736F7572636573
type=SYSCALL msg=audit(1677495059.158:2403): arch=c000003e syscall=257 success=no exit=-13 a0=ffffff9c a1=7ffd2795cc50 a2=80100 a3=0 items=0 ppid=23107 pid=24158 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4 comm="chronyc" exe="/usr/bin/chronyc" subj=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1677495059.158:2403): avc:  denied  { search } for  pid=24158 comm="chronyc" name="net" dev="proc" ino=13214 scontext=unconfined_u:unconfined_r:chronyc_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sysctl_net_t:s0 tclass=dir permissive=0

Comment 3 Zdenek Pytela 2023-03-03 11:44:49 UTC
It seems to be called from libnss_myhostname.so (systemd-libs):

chronyc  4059 [000]  1255.760563: avc:selinux_audited: requested=0x10000000 denied=0x10000000 audi>

        ffffffffbc0aa0a2 avc_audit_post_callback+0x202 ([kernel.kallsyms])
        ffffffffbc0aa0a2 avc_audit_post_callback+0x202 ([kernel.kallsyms])
        ffffffffbc0cea19 common_lsm_audit+0x69 ([kernel.kallsyms])
        ffffffffbc0aabda slow_avc_audit+0x7a ([kernel.kallsyms])
        ffffffffbc0ad767 audit_inode_permission+0x77 ([kernel.kallsyms])
        ffffffffbc0b31ee selinux_inode_permission+0x19e ([kernel.kallsyms])
        ffffffffbc0a690d security_inode_permission+0x2d ([kernel.kallsyms])
        ffffffffbbfd8b33 link_path_walk.part.0.constprop.0+0x2d3 ([kernel.kallsyms])
        ffffffffbbfd9611 path_openat+0xb1 ([kernel.kallsyms])
        ffffffffbbfda7f2 do_filp_open+0xb2 ([kernel.kallsyms])
        ffffffffbbfc32ca do_sys_openat2+0x9a ([kernel.kallsyms])
        ffffffffbbfc3693 __x64_sys_openat+0x53 ([kernel.kallsyms])
        ffffffffbc725159 do_syscall_64+0x59 ([kernel.kallsyms])
        ffffffffbc80009b entry_SYSCALL_64_after_hwframe+0x63 ([kernel.kallsyms])
                  13e9c6 __GI___openat+0x46 (inlined)
                    9f74 [unknown] (/usr/lib64/libnss_myhostname.so.2)
                   13db5 [unknown] (/usr/lib64/libnss_myhostname.so.2)
                    72f3 [unknown] (/usr/lib64/libnss_myhostname.so.2)
                    ec96 _nss_myhostname_gethostbyaddr2_r+0x266 (/usr/lib64/libnss_myhostname.so.2)
                    f166 _nss_myhostname_gethostbyaddr_r+0x16 (/usr/lib64/libnss_myhostname.so.2)
                  15dbae __new_gethostbyaddr_r+0x16e (inlined)
                  166cff __GI_getnameinfo+0x65f (inlined)
                    b595 DNS_IPAddress2Name.isra.0+0x75 (/usr/bin/chronyc)
                    b662 format_name+0x72 (inlined)
                    b884 format_name+0x1e4 (inlined)
                    b884 process_cmd_sources+0x1e4 (/usr/bin/chronyc)
                    ed8e process_line+0x2ece (inlined)

Comment 15 errata-xmlrpc 2023-11-07 08:52:17 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 (selinux-policy bug fix and enhancement update), 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-2023:6617


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