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 2038955 - FR cannot create a TCP socket (avc: denied { name_connect } for pid comm="radiusd" dest=1813 )
Summary: FR cannot create a TCP socket (avc: denied { name_connect } for pid comm="...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.6
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: 8.6
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-10 16:04 UTC by Filip Dvorak
Modified: 2022-05-10 16:25 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.14.3-87.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:15:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-107309 0 None Closed Jenkins Kubernetes plugins issues 2022-05-26 22:59:52 UTC
Red Hat Product Errata RHBA-2022:1995 0 None None None 2022-05-10 15:16:08 UTC

Description Filip Dvorak 2022-01-10 16:04:28 UTC
Description of problem:
FR can forward auth or acct messages to the second FR server. It uses UDP  protocol by default but in proxy.conf it is possible to configure to use TCP protocol between these servers. 
The problem is that the FR server cannot create a TCP connection because of selinux policy.
 
Version-Release number of selected component (if applicable):
RHEL-8.6.0-20220102.3
freeradius-3.0.20-12.module+el8.6.0+13617+542eca26.x86_64
selinux-policy-3.14.3-85.el8.noarch

How reproducible:


Steps to Reproduce:
1. dnf install freeradius freeradius-utils -y
2. configure home_server in /etc/raddb/proxy.conf
realm NULL {
}

realm redhat.com {
    pool = pool_redhat.com
    nostrip
}

home_server redhat.com {
    type = auth+acct
    ipaddr = #(random ip_addr)
    port = 1812
    secret = testing123
    status_check = none
    proto = tcp

}

home_server_pool pool_redhat.com {
    type = fail-over
    home_server = redhat.com
}

3. systemctl start radiusd
4. echo 'User-Name=localuser,Acct-Session-Id=60000061,Acct-Status-Type=Start,NAS-IP-Address=192.168.111.100,NAS-Port=0'| radclient -x localhost:1813 acct testing123 

Actual results:
radiusd log:
...
Error: Failed opening new proxy socket 'proxy (0.0.0.0, 0) -> home_server ($ip_addr, 1813)' : Failed connecting socket: Permission denied
...

AVC message:
type=PROCTITLE msg=audit(1641828609.991:359): proctitle=2F7573722F7362696E2F72616469757364002D64002F6574632F7261646462
type=SYSCALL msg=audit(1641828609.991:359): arch=c000003e syscall=42 success=no exit=-13 a0=8 a1=7f71c6f22a50 a2=10 a3=7f71c6f22ad8 items=0 ppid=1 pid=21784 auid=4294967295 uid=95 gid=95 euid=95 suid=95 fsuid=95 egid=95 sgid=95 fsgid=95 tty=(none) ses=4294967295 comm="radiusd" exe="/usr/sbin/radiusd" subj=system_u:system_r:radiusd_t:s0 key=(null)
type=AVC msg=audit(1641828609.991:359): avc:  denied  { name_connect } for  pid=21784 comm="radiusd" dest=1813 scontext=system_u:system_r:radiusd_t:s0 tcontext=system_u:object_r:radacct_port_t:s0 tclass=tcp_socket permissive=0

Expected results:
The FR should forward acct or auth messages to the home_server (ip_addr in a proxy.conf) via TCP

Additional info:
It is possible to use TCMS tests -> TCMS#597393	/CoreOS/freeradius/Multihost/copy-acct-to-home-server-sanity [freeradius:3.0 perl:5.26]

Comment 1 Milos Malik 2022-01-10 16:26:36 UTC
Caught in enforcing mode:
----
type=PROCTITLE msg=audit(01/10/2022 11:23:13.050:338) : proctitle=/usr/sbin/radiusd -d /etc/raddb 
type=SOCKADDR msg=audit(01/10/2022 11:23:13.050:338) : saddr={ saddr_fam=inet laddr=10.0.137.191 lport=1813 } 
type=SYSCALL msg=audit(01/10/2022 11:23:13.050:338) : arch=x86_64 syscall=connect success=no exit=EACCES(Permission denied) a0=0x8 a1=0x7f9294f4ca50 a2=0x10 a3=0x7f9294f4cad8 items=0 ppid=1 pid=21216 auid=unset uid=radiusd gid=radiusd euid=radiusd suid=radiusd fsuid=radiusd egid=radiusd sgid=radiusd fsgid=radiusd tty=(none) ses=unset comm=radiusd exe=/usr/sbin/radiusd subj=system_u:system_r:radiusd_t:s0 key=(null) 
type=AVC msg=audit(01/10/2022 11:23:13.050:338) : avc:  denied  { name_connect } for  pid=21216 comm=radiusd dest=1813 scontext=system_u:system_r:radiusd_t:s0 tcontext=system_u:object_r:radacct_port_t:s0 tclass=tcp_socket permissive=0 
----

Caught in permissive mode:
----
type=PROCTITLE msg=audit(01/10/2022 11:25:34.687:353) : proctitle=/usr/sbin/radiusd -d /etc/raddb 
type=SOCKADDR msg=audit(01/10/2022 11:25:34.687:353) : saddr={ saddr_fam=inet laddr=10.0.137.191 lport=1813 } 
type=SYSCALL msg=audit(01/10/2022 11:25:34.687:353) : arch=x86_64 syscall=connect success=no exit=EHOSTUNREACH(No route to host) a0=0x8 a1=0x7f45c5905a50 a2=0x10 a3=0x7f45c5905ad8 items=0 ppid=1 pid=21307 auid=unset uid=radiusd gid=radiusd euid=radiusd suid=radiusd fsuid=radiusd egid=radiusd sgid=radiusd fsgid=radiusd tty=(none) ses=unset comm=radiusd exe=/usr/sbin/radiusd subj=system_u:system_r:radiusd_t:s0 key=(null) 
type=AVC msg=audit(01/10/2022 11:25:34.687:353) : avc:  denied  { name_connect } for  pid=21307 comm=radiusd dest=1813 scontext=system_u:system_r:radiusd_t:s0 tcontext=system_u:object_r:radacct_port_t:s0 tclass=tcp_socket permissive=1 
----

Comment 2 Zdenek Pytela 2022-01-14 15:24:45 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/1002

Comment 4 Zdenek Pytela 2022-01-17 16:14:10 UTC
To backport:
commit cb03984acddb7a126e2aa854b52db767b15760a0 (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Fri Jan 14 16:15:18 2022 +0100

    Allow radiusd connect to the radacct port

Comment 14 errata-xmlrpc 2022-05-10 15:15:45 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-2022:1995


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