NetBSD Problem Report #44030

From www@NetBSD.org  Tue Nov  2 22:14:49 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id CB3BF63BA4E
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  2 Nov 2010 22:14:49 +0000 (UTC)
Message-Id: <20101102221445.7ADAE63BA0A@www.NetBSD.org>
Date: Tue,  2 Nov 2010 22:14:45 +0000 (UTC)
From: o.vd.linden@quicknet.nl
Reply-To: o.vd.linden@quicknet.nl
To: gnats-bugs@NetBSD.org
Subject: ifreqn2o gets called with the parameters the wrong way around in /sys/net/if.c
X-Send-Pr-Version: www-1.0

>Number:         44030
>Category:       kern
>Synopsis:       ifreqn2o gets called with the parameters the wrong way around in /sys/net/if.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 02 22:15:00 +0000 2010
>Closed-Date:    Tue Nov 02 23:30:10 +0000 2010
>Last-Modified:  Thu Jan 05 09:50:02 +0000 2012
>Originator:     Onno van der Linden
>Release:        NetBSD/i386 5.99.39
>Organization:
>Environment:
NetBSD sheep 5.99.39 NetBSD 5.99.39 (SHEEP) #2: Tue Nov  2 22:43:08 MET 2010  onno@sheep:/usr/src/sys/arch/i386/compile/SHEEP i386
>Description:
/sys/compat/sys/sockio.h defines ifreqn2o as #define ifreqn2o(oi, ni) followed by 2 memcpy()
calls that copy parts of the structure pointed to by ni to the structure pointed to by oi.
Currently, line 1820 of /sys/net/if.c says:  ifreqn2o(ifr, oifr);

Should be the other way around, just like the call to ifreqo2n got fixed earlier this year.
>How-To-Repeat:
Read the code, see also kern/42585
>Fix:
*** /sys/net/if.c.orig  Tue Nov  2 22:42:21 2010
--- /sys/net/if.c       Tue Nov  2 22:42:25 2010
***************
*** 1817,1823 ****
        }
  #ifdef COMPAT_OIFREQ
        if (cmd != ocmd)
!               ifreqn2o(ifr, oifr);
  #endif

        return error;
--- 1817,1823 ----
        }
  #ifdef COMPAT_OIFREQ
        if (cmd != ocmd)
!               ifreqn2o(oifr, ifr);
  #endif

        return error;

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44030 CVS commit: src/sys/net
Date: Tue, 2 Nov 2010 18:34:22 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Tue Nov  2 22:34:21 UTC 2010

 Modified Files:
 	src/sys/net: if.c

 Log Message:
 PR/44030: Onno van der Linden: ifreqn2o gets called with the parameters the
 wrong way around in /sys/net/if.c


 To generate a diff of this commit:
 cvs rdiff -u -r1.245 -r1.246 src/sys/net/if.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 02 Nov 2010 23:30:10 +0000
State-Changed-Why:
Christos fixed it.


From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/44030: ifreqn2o gets called with the parameters the wrong
 way around in /sys/net/if.c
Date: Thu, 17 Feb 2011 17:37:53 +0900

 Is it possible to pull-up this fix to netbsd-5?

 This changes revert PR#42585 and it was pulled up to netbsd-5.
 After PR#44054 was pulled up, I cannot reproduce PR#42585.

From: "Stephen Borrill" <sborrill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44030 CVS commit: [netbsd-5] src/sys/net
Date: Thu, 5 Jan 2012 09:47:39 +0000

 Module Name:	src
 Committed By:	sborrill
 Date:		Thu Jan  5 09:47:39 UTC 2012

 Modified Files:
 	src/sys/net [netbsd-5]: if.c

 Log Message:
 Pull up the following revisions(s) (requested by obache in ticket #1708):
 	sys/net/if.c:	revision 1.246

 PR/44030: ifreqn2o gets called with the parameters the wrong way around.
 Reverts fix for PR 42585 (ticket #1416) as the root cause of the crash is
 addressed by PR 44054 (pullup #1541).


 To generate a diff of this commit:
 cvs rdiff -u -r1.230.4.5 -r1.230.4.6 src/sys/net/if.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.