Bug 217241 - namei enforces symlink limits inconsistently
namei enforces symlink limits inconsistently
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2006-11-25 11:25 EST by Matt McCutchen
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-12-15 10:06:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Matt McCutchen 2006-11-25 11:25:11 EST
Description of problem:
When a path component refers to a symlink that would exceed the MAXSYMLINKS
limit, namei complains and drops that component, but it continues following the
remainder of the path.  Furthermore, it follows symlinks in the remainder of the
path without complaining, which can lead to infinite recursion and a
segmentation fault.  Namei should abort path resolution as soon as the
MAXSYMLINKS limit is first exceeded.

Additionally, it might be nice if namei enforced the kernel's limit of 8 levels
of symlink recursion; maybe this should be a separate request for enhancement.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
$ mkdir foo
$ cd foo
$ ln -s x x
$ namei x/x
Actual output:
f: x
 l x -> x
   l x -> x
     (18 lines snipped)
       l x -> x *** EXCEEDED UNIX LIMIT OF SYMLINKS ***
 l x -> x
   l x -> x
     (353 lines snipped)
       l x -> x
Segmentation fault

Expected output:
f: x
 l x -> x
   l x -> x
     (18 lines snipped)
        l x -> x *** EXCEEDED UNIX LIMIT OF SYMLINKS ***

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