Bug 85748

Summary: nameif segfaults if run twice
Product: [Retired] Red Hat Public Beta Reporter: Matt Domsch <matt_domsch>
Component: net-toolsAssignee: Phil Knirsch <pknirsch>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: phoebeCC: dannf, ecki, rvokal, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-03-19 10:08:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
I think this will fix it none

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