Bug 217241 - namei enforces symlink limits inconsistently
Summary: namei enforces symlink limits inconsistently
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-25 16:25 UTC by Matt McCutchen
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-12-15 15:06:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Matt McCutchen 2006-11-25 16:25:11 UTC
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):
util-linux-2.13-0.44

How reproducible:
Always

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.