Bug 85748 - nameif segfaults if run twice
Summary: nameif segfaults if run twice
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: net-tools
Version: phoebe
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: Ben Levenson
URL:
Whiteboard:
: 89441 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-03-06 20:36 UTC by Matt Domsch
Modified: 2015-03-05 01:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-03-19 10:08:29 UTC
Embargoed:


Attachments (Terms of Use)
I think this will fix it (1.75 KB, patch)
2003-03-06 23:47 UTC, Bernd Eckenfels
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2003:164 0 normal SHIPPED_LIVE Updated net-tools package fixes netstat -c output 2003-12-19 05:00:00 UTC

Description Matt Domsch 2003-03-06 20:36:00 UTC
Description of problem:
nameif segfaults if run twice.



Version-Release number of selected component (if applicable):
net-tools-1.60 (from RHL8.0 and Phoebe beta5+ "special bits of rawhide")

How reproducible:
always

This note sent to net-tools.de:

I'm running net-tools-1.60 as found in Red Hat Linux 7.3, 8.0, and
special bits of rawhide (precursor to the public release of the beta
known as Phoebe).  In all cases, nameif segfaults if run twice on a
system.


The general case seems to be at the end of main, it frees ch twice.  At
least that's my guess.  GDB shows the fault is in calling free here.

while (clist) { 
                struct change *ch = clist;
                clist = clist->next;
                warning(_("interface '%s' not found"), ch->ifname); 
                free(ch); 
        }


Here's what the program reports:

interface 'wireless' not found
interface '' not found
Segmentation fault

Here's what my mactab has:

builtin 00:06:5B:B6:8B:E4
wireless    00:02:2D:5D:1D:48
dock        00:06:5B:EA:36:7A
(those are tabs between the ifname and the mac).

Here's what /proc/net/dev shows:
Inter-|   Receive                                                | 
Transmit
 face |bytes    packets errs drop fifo frame compressed
multicast|bytes    packets errs drop fifo colls carrier compressed
    lo:  694808    6381    0    0    0     0          0         0  
694808    6381    0    0    0     0       0          0
builtin:       0       0    0    0    0     0          0        
0        0       0    0    0    0     0       0          0
  dock:98602373  291233    0    0    1     0          0         0 
6314187   53334    0    0    0     0       0          0
wireless:       0       0    0    0    0     0          0        
0        0       0    0    0    0     0       0          0


Since I've already called nameif once, my wireless device had its name
changed the first go-round.

I haven't had time to track this down further.  Any help would be
appreciated.

FWIW, I'm hoping to get Red Hat to add calling nameif during their
initscripts, inside
/etc/sysconfig/network-scripts/network-functions:is_available() after
the modprobe so we start getting the "right" names ASAP.

Comment 1 Matt Domsch 2003-03-06 23:15:55 UTC
Moving to Public Beta status so Bernd Eckenfels <ecki.de> can see it.
 The public beta behaves the same way.

Comment 2 Bernd Eckenfels 2003-03-06 23:47:59 UTC
Created attachment 90502 [details]
I think this will fix it

I annot reproduce it, but this patch produces a much simpler list handling. It
also fixes a small glitch in the usage printout, this is against 1.60. (CVS
nameif.c 1.1).

Comment 3 Matt Domsch 2003-03-07 05:50:07 UTC
The above patch fixes it for me.
Leaving open until it's included in a release or errata.


Comment 4 Larry Troan 2003-03-11 19:54:32 UTC
ISSUE TRACKER 17080 opened by Dell as Sev 3

Comment 5 Phil Knirsch 2003-03-19 10:08:29 UTC
Patch verified and included in net-tools-1.60-13

Read ya, Phil

Comment 6 Phil Knirsch 2003-04-22 23:00:37 UTC
*** Bug 89441 has been marked as a duplicate of this bug. ***

Comment 7 John Flanagan 2003-12-19 14:46:16 UTC
An errata 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 the 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/RHBA-2003-164.html



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