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 1851816 - [RHEL8]: avc: denied { getattr } for pid=58539 comm="smbd" path="/mnt/cifs/dev"
Summary: [RHEL8]: avc: denied { getattr } for pid=58539 comm="smbd" path="/mnt/cifs...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.3
Hardware: Unspecified
OS: Linux
low
low
Target Milestone: rc
: 8.3
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-29 05:39 UTC by xiaoli feng
Modified: 2020-11-04 21:12 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:56:46 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4528 0 None None None 2020-11-04 01:57:16 UTC

Description xiaoli feng 2020-06-29 05:39:58 UTC
Description of problem:
Setup samba server in RHEL-8.3. In server, creat the char device by this command "mknod dev c 1 3". Then in client, mount the samba share and ls the mounted directory. Can't display the char device "dev". And server has this avc denied. "avc:  denied  { getattr } for  pid=58539 comm="smbd" path="/mnt/cifs/dev".

Reproducer:
In server:
#yum install samba samba-client -y
# cat /etc/samba/smb.conf
[cifs]
writeable=yes
path=/mnt/cifs
#mkdir -p /mnt/cifs
#chcon -t samba_share_t /mnt/cifs
#setsebool -P samba_export_all_rw on
#echo -e "redhat\nredhat" |smbpasswd -a root -s
#mknod /mnt/cifs/dev c 1 3
#systemctl start smb

In client:
#yum install cifs-utils
#mkdir cifs
#mount //$server/cifs cifs -o user=root,password=redhat,sfu 
#ls cifs

Here can't list the file "dev".
And in server, there are avc denied.
type=AVC msg=audit(1593407329.708:350): avc:  denied  { getattr } for  pid=58539 comm="smbd" path="/mnt/cifs/dev" dev="dm-0" ino=18034802 scontext=system_u:system_r:smbd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=chr_file permissive=0
type=SYSCALL msg=audit(1593407329.708:350): arch=c000003e syscall=262 success=no exit=-13 a0=19 a1=558ee32fa62b a2=7ffe4d742ea0 a3=100 items=0 ppid=58530 pid=58539 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="smbd" exe="/usr/sbin/smbd" subj=system_u:system_r:smbd_t:s0 key=(null)ARCH=x86_64 SYSCALL=newfstatat AUID="unset" UID="root" GID="root" EUID="root" SUID="root" FSUID="root" EGID="root" SGID="root" FSGID="root"
type=PROCTITLE msg=audit(1593407329.708:350): proctitle=2F7573722F7362696E2F736D6264002D2D666F726567726F756E64002D2D6E6F2D70726F636573732D67726F7570
type=AVC msg=audit(1593407329.708:351): avc:  denied  { getattr } for  pid=58539 comm="smbd" path="/mnt/cifs/dev" dev="dm-0" ino=18034802 scontext=system_u:system_r:smbd_t:s0 tcontext=unconfined_u:object_r:samba_share_t:s0 tclass=chr_file permissive=0
type=SYSCALL msg=audit(1593407329.708:351): arch=c000003e syscall=4 success=no exit=-13 a0=558ee32ed2e0 a1=7ffe4d742f10 a2=7ffe4d742f10 a3=100 items=0 ppid=58530 pid=58539 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="smbd" exe="/usr/sbin/smbd" subj=system_u:system_r:smbd_t:s0 key=(null)ARCH=x86_64 SYSCALL=stat AUID="unset" UID="root" GID="root" EUID="root" SUID="root" FSUID="root" EGID="root" SGID="root" FSGID="root"

Version-Release number of selected component (if applicable):
selinux-policy-3.14.3-46.el8.noarch
4.18.0-221.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
Can't show char device file in client.

Expected results:
Can show char device file in client.

Additional info:

Comment 1 Zdenek Pytela 2020-06-29 06:52:46 UTC
Hi,

Thank you for the reproducer scenario and description. Apart from the denial, is there any other problem with functionality?

Comment 2 xiaoli feng 2020-06-30 08:38:14 UTC
(In reply to Zdenek Pytela from comment #1)
> Hi,
> 
> Thank you for the reproducer scenario and description. Apart from the
> denial, is there any other problem with functionality?

Yes, I think there is. For SMB1.0, it supports special device file(such as char device). When create this kind of files in server, these files can be displayed in client. If not, the users can't deal with them. For SMB2.0+, they don't support special device file(server side), but support in client. It means only can identify these kind of files when create them in client. And identify these kind of files as regular files if they are creaded in server. Now because of avc defined, All SMB protocols can't show these files in client when create in server side.

Comment 3 xiaoli feng 2020-07-21 07:24:43 UTC
Hello Zdenek,

What's going on for this bug?

Comment 4 Zdenek Pytela 2020-07-21 07:29:55 UTC
This bug has not been acknowledged to be resolved during the RHEL 8.3 development and testing phase, so it will be evaluated for inclusion into the next minor product update.

If you want to pursue this issue further, please attach information regarding severity of the bugzilla. If a fix in RHEL 8.3 is requested, raise the exception or blocker flag and answer the subsequent questions.

Comment 7 xiaoli feng 2020-07-22 01:49:28 UTC
Hello Milos,

Could you help to review this bug and provide qa_ack+?

Thanks.

Comment 8 xiaoli feng 2020-07-22 01:52:59 UTC
Hello Zdenet,

Could you help to provide devel_ack+?

Thanks.

Comment 12 Zdenek Pytela 2020-07-28 17:58:48 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy-contrib/pull/313

Comment 23 errata-xmlrpc 2020-11-04 01:56:46 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-2020:4528


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