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 720325 - "/bin/ls -l" does a getxattr() through libacl that should be an lgetxattr()
Summary: "/bin/ls -l" does a getxattr() through libacl that should be an lgetxattr()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: coreutils
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On: 692823 692982 720318 733978
Blocks: 719607 733979
TreeView+ depends on / blocked
 
Reported: 2011-07-11 11:55 UTC by Ian Kent
Modified: 2018-11-26 18:26 UTC (History)
14 users (show)

Fixed In Version: coreutils-8.4-16.el6
Doc Type: Bug Fix
Doc Text:
Prior to this update, the acl_extended_file() function could cause unnecessary mounts of autofs when using the ls command on a directory with autofs mounted. This update adds a new acl function, acl_extended_file_nofollow(), to prevent unnecessary autofs mounts.
Clone Of: 692823
: 733979 (view as bug list)
Environment:
Last Closed: 2011-12-06 17:12:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fixup for the regression caused by the original patch V2 (2.26 KB, patch)
2011-10-02 08:27 UTC, Kamil Dudka
ovasik: review+
Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1693 0 normal SHIPPED_LIVE coreutils bug fix update 2011-12-06 00:49:52 UTC

Comment 2 RHEL Program Management 2011-07-11 12:18:14 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 6 Kamil Dudka 2011-07-25 13:27:21 UTC
upstream commit:

http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=95f7c57

Comment 9 Kamil Dudka 2011-08-17 05:22:38 UTC
coreutils needs to be rebuilt against libacl-devel >= 2.2.49-6:

checking for acl_extended_file... yes
checking for acl_extended_file_nofollow... no

spotted while examining bug #720318 comment #9

Comment 13 Eliska Slobodova 2011-09-19 14:22:29 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the acl_extended_file() function could cause unnecessary mounts of autofs when using the ls command on a directory with autofs mounted. This update adds a new acl function, acl_extended_file_nofollow(), to prevent unnecessary autofs mounts.

Comment 16 Ondrej Moriš 2011-10-02 08:19:01 UTC
I would prefer respin as well, moreover, I can confirm that attached patch resolves acl issue mentioned 11607#c28 and, at the same time, keeps coreutils selftest passing (however I noticed that some tests are SKIPPED).

Comment 17 Kamil Dudka 2011-10-02 08:27:10 UTC
Created attachment 525910 [details]
fixup for the regression caused by the original patch V2

Comment 19 Ondrej Vasik 2011-10-02 08:45:17 UTC
Comment on attachment 525910 [details]
fixup for the regression caused by the original patch V2

Thanks for the patch Kamil, looks almost sane, only #if HAVE_ACL_EXTENDED_FILE_NOFOLLOW should be # if HAVE_ACL_EXTENDED_FILE_NOFOLLOW - for the coding style conformance.

Comment 20 Kamil Dudka 2011-10-02 08:49:36 UTC
Indeed, will reflect that in the upstream submission next week.

Comment 21 Kamil Dudka 2011-10-02 09:12:43 UTC
(In reply to comment #20)
> Indeed, will reflect that in the upstream submission next week.

Also the acl_extended_file_wrap function should be declared static...

Comment 22 Kamil Dudka 2011-10-03 10:34:31 UTC
sent upstream:

http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28538

Comment 23 Kamil Dudka 2011-10-03 17:34:02 UTC
Ian, do we need to treat symlinks to mount points anyhow specially in this fix?  Or is it just fine to issue getxattr syscalls on them?

There was a discussion about them on the upstream mailing list:

http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28538/focus=28555

Comment 24 Ian Kent 2011-10-04 03:25:13 UTC
(In reply to comment #23)
> Ian, do we need to treat symlinks to mount points anyhow specially in this fix?
>  Or is it just fine to issue getxattr syscalls on them?

I don't think so because the semantic behaviour is (was) supposed
to follow that of symlinks. So any time there's a follow implied
by a system call an automount should be transparently (to user
space) mounted. 

> 
> There was a discussion about them on the upstream mailing list:
> 
> http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28538/focus=28555

>> But still still does not fix the problem of case f). Here, with your current
>> patch, "ls -lLd symlink-to-mountpoint" will call acl_extended_file(), which
>> will call getxattr(), which will activate an autofs mount.

Which, with the intended semantics, is what I think should
happen. In this case causing everything within the directory
to be mounted would be considered a deliberate request by the
user.

>> IMO, there are two solutions to this:
>>  - Either convince the kernel people to introduce a different flag, keeping
>>    LOOKUP_FOLLOW for symlinks only,

There has been some spirited debate over this change upstream
recently related to the overloading of the LOOKUP_FOLLOW flag.

After some opposition we ended up with a LOOKUP_AUTOMOUNT flag
but, because it was felt that changing semantic behaviour would
be too problematic for user space (even though this is the only
case we have seen in over six months), the semantics have been
changed back to what they were previously from 3.1.0 (which is
obviously too late for RHEL-6.2).

I still believe the semantic behaviour change is the right
choice for automounting and will, at some point, be looking
to change it back again. But that will mean addition of things
like IS_AUTO(mode) etc. as well as related package modifications
and overcoming the existing opposition to the change.

Sorry for the inconvenience this has caused.
Ian

Comment 25 Ian Kent 2011-10-04 03:38:54 UTC
> Well, symlinks to mount points were not mentioned in that bug.  I would need 
> to ask kernel guys whether symlinks to mount points are worth to consider in 
> this fix at all.

I don't think this is really a consideration.

The point of the change was to be able to long list directory
contents of an automount managed directory. In that case
stat()ing a symlink to a mount point a mount would occur which
is what should happen IMHO.

The directory listing case should consistently use the nofollow
variants of system calls and it was agreed that behaviour was
the right way to do it in the beginning of this bug.

Comment 26 Ian Kent 2011-10-04 04:15:32 UTC
>   1) understand better which file system operations triggered the autofs
>      mounts, I can't really beleive that calling getxattr on a non-symlink
>      will trigger autofs mounts.

Ummm ... what!

If it isn't a symlink then it might be a directory and it might
be an automount point. So IMO it should be mounted so the caller
gets the information of the file system it is expecting without
it changing under it.

This is the no-win situation that has plagued us for a long
time. For example,

With the semantics that I believe are needed:
getxattr(), followed by open(), followed by getxattr() will
return the same attributes for both getxattr() calls (good
behaviour).

With the pre-existing semantics:
getxattr(), followed by open(), followed by getxattr() can
return different attributes for getxattr() (bad behaviour).

With either semantics:
lgetxattr(), followed by open(), followed by lgetxattr() can
return different attributes for getxattr() (bad unavoidable
behaviour).

So the issues go on and on. My real goal, and the only
realistic one, is to minimize the bad behaviour since we can't
just always automount every time we hit a mount point due to
mount storm type problems.

Ian

Comment 27 Ian Kent 2011-10-04 04:19:36 UTC
(In reply to comment #26)
> 
> With either semantics:
> lgetxattr(), followed by open(), followed by lgetxattr() can
> return different attributes for getxattr() (bad unavoidable
> behaviour).

Those last two lines should read:
return different attributes for lgetxattr() (bad unavoidable
behaviour).

Comment 33 errata-xmlrpc 2011-12-06 17:12:44 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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1693.html


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