Bug 60866 - lslk segfaults if network filesystems are down
lslk segfaults if network filesystems are down
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: lslk (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jindrich Novy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-07 20:21 EST by Chris Ricker
Modified: 2013-07-02 18:55 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-10 08:11:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
This patch should prevent lslk from segfault when readlink() fails. (698 bytes, patch)
2004-09-10 08:10 EDT, Jindrich Novy
no flags Details | Diff

  None (edit)
Description Chris Ricker 2002-03-07 20:21:00 EST
When I run lslk, it just segmentation faults.

This appears to be because I have some SMB mounts over an IPSec tunnel which are
currently hung because the tunnel is temporarily down.

end of strace:
alarm(15)                               = 0
readlink("/home/kaboom/work-fs", 0xbfffc7f0, 4094) = -1 EINVAL (Invalid argument)
alarm(0)                                = 15
rt_sigaction(SIGALRM, {SIG_DFL}, {0x804c110, [ALRM], SA_RESTART|0x4000000}, 8) = 0
rt_sigaction(SIGALRM, {0x804c110, [ALRM], SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0
alarm(15)                               = 0
readlink("/home/kaboom/work-fs/courseware", 0xbfffc7f0, 4094) = -1 EINVAL
(Invalid argument)
alarm(0)                                = 15
rt_sigaction(SIGALRM, {SIG_DFL}, {0x804c110, [ALRM], SA_RESTART|0x4000000}, 8) = 0
rt_sigaction(SIGALRM, {0x804c110, [ALRM], SA_RESTART|0x4000000}, {SIG_DFL}, 8) = 0
alarm(15)                               = 0
stat64("/home/kaboom/work-fs/courseware", 0xbfffc710) = -1 EIO (Input/output error)
--- SIGALRM (Alarm clock) ---
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

/home/kaboom/work-fs/courseware is a SMB mount for which the underlying
transport is currently down.

lslk -b avoids the block, but it still shouldn't segfault in the absence of the -b
Comment 1 Chris Ricker 2002-07-09 22:27:49 EDT
hit this again on 7.3
Comment 2 Jindrich Novy 2004-09-10 08:07:38 EDT
Chris, it seems like lslk naively assumes that readlink() and malloc()
couldn't ever fail in function get_path_and_sz(). This assumption is
not quite bad for malloc() but in case of readlink() things goes wrong.

Jindrich
Comment 3 Jindrich Novy 2004-09-10 08:10:28 EDT
Created attachment 103684 [details]
This patch should prevent lslk from segfault when readlink() fails.

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