Bug 619112
| Summary: | CIFS mount to samba3x share shows differing ownership on sequential stat() calls to same file | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Justin Payne <jpayne> | ||||||||||||
| Component: | kernel | Assignee: | Jeff Layton <jlayton> | ||||||||||||
| Status: | CLOSED ERRATA | QA Contact: | yanfu,wang <yanwang> | ||||||||||||
| Severity: | high | Docs Contact: | |||||||||||||
| Priority: | high | ||||||||||||||
| Version: | 5.5 | CC: | eguan, jentrena, kzhang, smarkovi, steved, tao, yanwang | ||||||||||||
| Target Milestone: | rc | ||||||||||||||
| Target Release: | --- | ||||||||||||||
| Hardware: | All | ||||||||||||||
| OS: | Linux | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||||||
| Doc Text: | Story Points: | --- | |||||||||||||
| Clone Of: | Environment: | ||||||||||||||
| Last Closed: | 2011-01-13 21:45:49 UTC | Type: | --- | ||||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||||
| Documentation: | --- | CRM: | |||||||||||||
| Verified Versions: | Category: | --- | |||||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||||
| Embargoed: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Justin Payne
2010-07-28 15:36:21 UTC
Created attachment 435052 [details]
text tcpdump
Best tcpdump I have until I can gather a binary dump.
Created attachment 435056 [details]
verbose cifs data
dmesg output after touching said file as user bdeadm
Created attachment 435059 [details]
binary tcpdump taken from samba server in the lab
Binary tcpdump taken from samba server in the lab. The following actions were performed as user bdeadm on the client:
# su - bdeadm
$ cd /mnt/qassamba
$ touch testfile
$ stat testfile
Created attachment 435061 [details]
binary tcpdump taken from CIFS client
Binary tcpdump taken from CIFS client in the lab. The following actions were
performed as user bdeadm:
# su - bdeadm
$ cd /mnt/qassamba
$ touch testfile
$ stat testfile
> Binary tcpdump taken from CIFS client in the lab. The following actions were
> performed as user bdeadm:
>
> # su - bdeadm
> $ cd /mnt/qassamba
>
> $ touch testfile
> $ stat testfile
That doesn't look like the same reproducer that the customer was using. Were you able to reproduce the problem with that?
The reproducer is in /usr/local/bin/testutil. The source code of the reproducer is in /root/testutil.c . Testing on my own machine...it looks like the ownership of the file (inode->i_uid) is changing. Here are 3 consecutive calls to cifs_permission: fs/cifs/cifsfs.c: cifs_permission: mask=0x2 inode=ffff81003ebf2090 owner=15512 fsuid=50000 fs/cifs/cifsfs.c: cifs_permission: mask=0x1 inode=ffff81003ebf29d0 owner=50000 fsuid=50000 fs/cifs/cifsfs.c: cifs_permission: mask=0x2 inode=ffff81003ebf2090 owner=15512 fsuid=50000 ...how it's changing like this is not 100% clear to me yet. Ahh, nm those are two different inodes. I think I understand the problem now though: posix_fill_in_inode has a force_uid_gid flag and that's being set in some cases. That prevents the uid= parm from taking effect here. When I clear that flag it works as expected. That should also fix the problems with stat() returning different info. I forget however, why that flag is there in the first place, so I'll need to do a little archaeology to determine what the proper fix is. Created attachment 435096 [details]
patch -- make cifs always override uid/gid
Here's a proposed patch for RHEL5
This patch seems to fix the "touch" testcase for me. I assume it'll probably fix the other testcase too. Could you test it and report back to me whether it does?
Event posted on 07-28-2010 09:08pm EDT by jpayne Hi, Please have the customer test the packages found at: http://people.redhat.com/jpayne/1093523/ Thanks, Justin Internal Status set to 'Waiting on Support' This event sent from IssueTracker by jpayne issue 1093523 Event posted on 13:00:33, 3rd Aug, 2010 BST by jentrena Hi Justin, The customer reports that the test package solves the bug for them. Thank you. Julio Internal Status set to 'Waiting on SEG' This event sent from IssueTracker by jentrena issue 1093523 The test packages solves the bug. This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release. in kernel-2.6.18-214.el5 You can download this test kernel from http://people.redhat.com/jwilson/el5 Detailed testing feedback is always welcomed. Reproduced on -194 kernel(both server and client) (To simplify setup, I did setenforce 0) [tester@dhcp-65-135 ~]$ id uid=501(tester) gid=501(tester) groups=501(tester) context=root:system_r:unconfined_t:SystemLow-SystemHigh [tester@dhcp-65-135 ~]$ mount | grep cifs //sun-x4440-01.rhts.eng.bos.redhat.com/public on /mnt type cifs (rw,mand) [tester@dhcp-65-135 ~]$ ./testutil /mnt/testfile Open1: 3 0 Close: 0 0 Start: 0 0 u:500 g:500 mode:0100770 Open2: -1 13 Start: 0 13 u:501 g:501 mode:0100770 Open3: 3 13 [tester@dhcp-65-135 ~]$ Verified on -231 kernel(both server and client) [tester@dhcp-65-135 ~]$ id uid=501(tester) gid=501(tester) groups=501(tester) context=root:system_r:unconfined_t:SystemLow-SystemHigh [tester@dhcp-65-135 ~]$ mount | grep cifs //sun-x4440-01.rhts.eng.bos.redhat.com/public on /mnt type cifs (rw,mand) [tester@dhcp-65-135 ~]$ ./testutil /mnt/testfile Open1: 3 0 Close: 0 0 Start: 0 0 u:501 g:501 mode:0100770 Open2: 3 0 <======= The second open succeed and ownership didn't change Start: 0 0 u:501 g:501 mode:0100770 Open3: 4 0 [tester@dhcp-65-135 ~]$ An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0017.html |