Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2073349

Summary: SELinux prevents the ntlm_auth process from reading the /proc/net/unix file
Product: Red Hat Enterprise Linux 8 Reporter: Filip Dvorak <fdvorak>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: low Docs Contact:
Priority: low    
Version: 8.6CC: lvrabec, mmalik, nknazeko, ssekidde
Target Milestone: rcKeywords: AutoVerified, Triaged
Target Release: 8.7Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-97.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 10:44:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Filip Dvorak 2022-04-08 09:27:14 UTC
Description of problem:
There is a AVC message during ntlm auth with Freeradius and samba/winbind. 

Version-Release number of selected component (if applicable):
freeradius-3.0.20-12.module+el8.6.0+13617+542eca26.x86_64
samba-4.15.5-5.el8.x86_64
samba-winbind-4.15.5-5.el8.x86_64
selinux-policy-3.14.3-95.el8.noarch
selinux-policy-targeted-3.14.3-95.el8.noarch

How reproducible:

Steps to Reproduce:
dnf install -y freeradius freeradius-utils samba samba-common samba-winbind samba-winbind-clients samba-client wpa_supplicant

1. Freeradius:
sed -i 's/default_eap_type = md5/default_eap_type = peap/' /etc/raddb/mods-enabled/eap
sed -i '/peap {/,/}/ s/^.*copy_request_to_tunnel.*/copy_request_to_tunnel = yes/'  /etc/raddb/mods-enabled/eap
sed -i '/peap {/,/}/ s/^.*use_tunneled_reply.*/use_tunneled_reply = yes/'  /etc/raddb/mods-enabled/eap
sed -i 's|^mschap {|mschap {\n\tntlm_auth = \"/usr/bin/ntlm_auth --request-nt-key --allow-mschapv2 --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --nt-response=%{%{msch    ap:NT-Response}:-00} --domain=QAkR184\"\n|' /etc/raddb/mods-enabled/mschap
gpasswd -a radiusd wbpriv

2. Samba:
#/etc/samba/smb.conf
[global]
        domain logons = Yes
        load printers = No
        netbios name = QAKR184
        ntlm auth = ntlmv1-permitted
        printcap name = cups
        security = USER
        idmap config * : backend = tdb
        admin users = root nbusr
        cups options = raw

echo "WINBINDOPTIONS=\"-s /etc/samba/winbindd.conf\"" >> /etc/sysconfig/samba

#useradd -m nbusr
#echo -en "nbusr123\nnbusr123\n" | /usr/bin/smbpasswd -L -s -a nbusr
#useradd -g nobody -s /bin/false -d / 'QAkR184$'
#smbpasswd -a -n -m QAkR184

3. winbind:
#cat /etc/samba/winbindd.conf 
include = /etc/samba/smb.conf
[global]
security = domain
domain logons = yes

netbios name = QAkR184

4. run eapol tests
eapol_test -c ./mschap.conf -s testing123

#cat ./mschap.conf 
network={
        ssid="QA test 802.1x network"
        key_mgmt=WPA-EAP
	eap=PEAP
	phase2="autheap=MSCHAPv2"
	identity="nbusr"
	password="nbusr123"
	ca_cert="/etc/raddb/certs/ca.pem"
}



Actual results:
eapol tests passed but there is an AVC message

Enforcing:
time->Fri Apr  8 05:23:01 2022
type=PROCTITLE msg=audit(1649409781.059:975): proctitle=2F7573722F62696E2F6E746C6D5F61757468002D2D726571756573742D6E742D6B6579002D2D757365726E616D653D6E62757372002D2D6368616C6C656E67653D36383639666333323737336334643134002D2D6E742D726573706F6E73653D3362356539663536616464626539646365626439316430646131363732323637
type=PATH msg=audit(1649409781.059:975): item=0 name="/proc/net/unix" inode=4026532055 dev=00:05 mode=0100444 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:proc_net_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=CWD msg=audit(1649409781.059:975): cwd="/"
type=SYSCALL msg=audit(1649409781.059:975): arch=c000003e syscall=21 success=no exit=-13 a0=7fff53b4d7e0 a1=4 a2=8 a3=1d items=1 ppid=25175 pid=25208 auid=4294967295 uid=95 gid=95 euid=95 suid=95 fsuid=95 egid=95 sgid=95 fsgid=95 tty=(none) ses=4294967295 comm="ntlm_auth" exe="/usr/bin/ntlm_auth" subj=system_u:system_r:winbind_helper_t:s0 key=(null)
type=AVC msg=audit(1649409781.059:975): avc:  denied  { read } for  pid=25208 comm="ntlm_auth" name="unix" dev="proc" ino=4026532055 scontext=system_u:system_r:winbind_helper_t:s0 tcontext=system_u:object_r:proc_net_t:s0 tclass=file permissive=0

Permissive:
time->Fri Apr  8 05:23:38 2022
type=PROCTITLE msg=audit(1649409818.237:978): proctitle=2F7573722F62696E2F6E746C6D5F61757468002D2D726571756573742D6E742D6B6579002D2D757365726E616D653D6E62757372002D2D6368616C6C656E67653D66653835666134623234386534353336002D2D6E742D726573706F6E73653D3862613865663431343230383739306164613135653032663235613738383334
type=PATH msg=audit(1649409818.237:978): item=0 name="/proc/net/unix" inode=4026532055 dev=00:05 mode=0100444 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:proc_net_t:s0 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
type=CWD msg=audit(1649409818.237:978): cwd="/"
type=SYSCALL msg=audit(1649409818.237:978): arch=c000003e syscall=21 success=yes exit=0 a0=7ffcc1fc7aa0 a1=4 a2=8 a3=1d items=1 ppid=25175 pid=25214 auid=4294967295 uid=95 gid=95 euid=95 suid=95 fsuid=95 egid=95 sgid=95 fsgid=95 tty=(none) ses=4294967295 comm="ntlm_auth" exe="/usr/bin/ntlm_auth" subj=system_u:system_r:winbind_helper_t:s0 key=(null)
type=AVC msg=audit(1649409818.237:978): avc:  denied  { read } for  pid=25214 comm="ntlm_auth" name="unix" dev="proc" ino=4026532055 scontext=system_u:system_r:winbind_helper_t:s0 tcontext=system_u:object_r:proc_net_t:s0 tclass=file permissive=1

Expected results:
No AVC message

Additional info:
It is possible to use this test:
CoreOS/freeradius/Sanity/samba-windows-domain-integration/

Comment 2 Zdenek Pytela 2022-04-21 09:24:51 UTC
Commit to backport:
commit a25be3b47116f3b53c3e2be28c5ba7cc48ec0939 (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Thu Apr 21 10:36:55 2022 +0200

    Allow ntlm_auth read the network state information

Comment 12 errata-xmlrpc 2022-11-08 10:44:11 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:7691