NetBSD Problem Report #8119

Received: (qmail 21003 invoked from network); 30 Jul 1999 15:46:57 -0000
Message-Id: <199907301546.IAA21423@nooksack.ldc.cs.wwu.edu>
Date: Fri, 30 Jul 1999 08:46:51 -0700 (PDT)
From: weiss@uni-mainz.de
Reply-To: weiss@uni-mainz.de
To: gnats-bugs@gnats.netbsd.org
Subject: change in get_myaddress breaks rpc.bootparamd
X-Send-Pr-Version: www-1.0

>Number:         8119
>Category:       bin
>Synopsis:       change in get_myaddress breaks rpc.bootparamd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    drochner
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 30 08:50:01 +0000 1999
>Closed-Date:    Fri Apr 04 20:32:40 +0000 2003
>Last-Modified:  Fri Apr 04 20:32:40 +0000 2003
>Originator:     Juergen Weiss
>Release:        1.4
>Organization:
Universitaet Mainz
>Environment:

>Description:
Netbooting Solaris 2.5 does not work anymore. Worked in 1.3.
Rpc.bootparamd uses get_myaddress to get IP address of
network interface, from which the client should boot. From
version 1.4 NetBSD's get_myaddress returns 127.0.0.1, which makes the
client rather unhappy. Netbooting NetBSD Sparc works, because
the rpc which uses get_myaddress is not used.
>How-To-Repeat:

See above
>Fix:

Restore the old NetBSD 1.3 functionality of get_myaddress
or change rpc.bootparamd not to use get_myaddress any more.
>Release-Note:
>Audit-Trail:

From: Matthias Drochner <drochner@zel459.zel.kfa-juelich.de>
To: weiss@uni-mainz.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd 
Date: Fri, 30 Jul 1999 19:01:23 +0200

 Does the following fix work for you?

 best regards
 Matthias


 Index: bootparamd.c
 ===================================================================
 RCS file: /cvsroot/basesrc/usr.sbin/rpc.bootparamd/bootparamd.c,v
 retrieving revision 1.20
 diff -c -2 -r1.20 bootparamd.c
 *** bootparamd.c	1999/06/06 02:47:48	1.20
 --- bootparamd.c	1999/07/30 16:53:13
 ***************
 *** 53,59 ****
   int     dolog = 0;
   struct in_addr route_addr;
 - struct sockaddr_in my_addr;
   extern char *__progname;
   char   *bootpfile = _PATH_BOOTPARAMS;

   int	main __P((int, char *[]));
 --- 53,59 ----
   int     dolog = 0;
   struct in_addr route_addr;
   extern char *__progname;
   char   *bootpfile = _PATH_BOOTPARAMS;
 + char	myname[MAXHOSTNAMELEN];

   int	main __P((int, char *[]));
 ***************
 *** 112,117 ****

   	if (route_addr.s_addr == 0) {
 ! 		get_myaddress(&my_addr);
 ! 		route_addr.s_addr = my_addr.sin_addr.s_addr;
   	}
   	if (!debug) {
 --- 112,120 ----

   	if (route_addr.s_addr == 0) {
 ! 		if (gethostname(myname, sizeof(myname)) == 0 &&
 ! 		    (he = gethostbyname(myname)) != NULL)
 ! 			memmove(&route_addr.s_addr, he->h_addr, he->h_length);
 ! 		else
 ! 			warnx("can't determine local address, no router set");
   	}
   	if (!debug) {



From: David Brownlee <abs@anim.dreamworks.com>
To: weiss@uni-mainz.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd
Date: Fri, 30 Jul 1999 10:13:05 -0700 (PDT)

 	It might be an idea to try downloading the -current source for
 	rpc.bootparamd and see if it is fixed there?

 		David/absolute

 	 -=-  "Just adding to the wrinkles on his deathly frown"  -=-

 On Fri, 30 Jul 1999 weiss@uni-mainz.de wrote:

 > 
 > >Number:         8119
 > >Category:       bin
 > >Synopsis:       change in get_myaddress breaks rpc.bootparamd
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    bin-bug-people
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri Jul 30 08:50:01 1999
 > >Last-Modified:
 > >Originator:     Juergen Weiss
 > >Organization:
 > Universitaet Mainz
 > >Release:        1.4
 > >Environment:
 > 
 > >Description:
 > Netbooting Solaris 2.5 does not work anymore. Worked in 1.3.
 > Rpc.bootparamd uses get_myaddress to get IP address of
 > network interface, from which the client should boot. From
 > version 1.4 NetBSD's get_myaddress returns 127.0.0.1, which makes the
 > client rather unhappy. Netbooting NetBSD Sparc works, because
 > the rpc which uses get_myaddress is not used.
 > >How-To-Repeat:
 > 
 > See above
 > >Fix:
 > 
 > Restore the old NetBSD 1.3 functionality of get_myaddress
 > or change rpc.bootparamd not to use get_myaddress any more.
 > >Audit-Trail:
 > >Unformatted:
 > 


From: Juergen Weiss <weiss@Uni-Mainz.DE>
To: M.Drochner@fz-juelich.de
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd 
Date: Fri, 6 Aug 1999 11:23:35 +0200 (MET DST)

 Matthias Drochner writes:
  > 
  > Does the following fix work for you?
  > 

 The fix works for me. But I wonder if it's really a good idea to
 change the rpc function get_myaddress in this way. At least it
 should be documented. I do not know, if the change was made to
 fix security problems in the portmapper daemon related to
 forwarding of udp rpc requests to other hosts. Maybe this should
 have been fixed directly in the portmapper daemon. Though
 get_myaddress need not get used in the bootparamd anyway.
 It's main function seems to be in the initalisation process
 of yp.

 Greetings

 Jürgen Weiß

 -- 
 Juergen Weiss		| Universitaet Mainz, Zentrum f"ur Datenverarbeitung,
 weiss@uni-mainz.de      | 55099 Mainz, Tel: 06131/39-6361, FAX: 06131/39-6407

From: Matthias Drochner <drochner@zel459.zel.kfa-juelich.de>
To: Juergen Weiss <weiss@Uni-Mainz.DE>
Cc: M.Drochner@fz-juelich.de, gnats-bugs@gnats.netbsd.org
Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd 
Date: Sat, 07 Aug 1999 15:51:18 +0200

 weiss@Uni-Mainz.DE said:
 > The fix works for me. But I wonder if it's really a good idea to
 > change the rpc function get_myaddress in this way. At least it should
 > be documented.

 Agreed.

 > I do not know, if the change was made to fix security problems in the
 > portmapper daemon related to forwarding of udp rpc requests to other
 > hosts. Maybe this should have been fixed directly in the portmapper
 > daemon.

 The change fixes a security hole not directly in the portmap daemon
 but a weakness in the RPC protocol: registering of services is
 an RPC call just like any other client access. Thus remote hosts
 could (de)register services, committing DOS attacks this way.
 The change affects the RPC client library (pmap_clnt). Perhaps
 only the pmap_set()/pmap_unset() functions should have been changed,
 but it happened the way it did. The automounter is the only
 program besides bootparamd which uses get_myaddress() directly, and
 it seems to be happy.

 I'd say bootparamd's use of get_myaddress() is broken -- or is it
 the idea of get_myaddress() as such? Strickly speaking, there
 is nothing like a machine's single IP address.
 (bootparamd's idea to use it as gateway is not worth much either, as
 is the whole bootparam protocol which doesn't provide a way to pass
 a netmask to the address)

 So from the practical point of view I even consider my change an improvement
 since `hostname` is more likely to lead to an IP address useful for
 diskless clients than an address from a randomly picked interface.
 It should be documented, as said.

 I'll try to get more opinions.

 best regards
 Matthias



From: Juergen Weiss <weiss@Uni-Mainz.DE>
To: M.Drochner@fz-juelich.de, gnats-bugs@gnats.netbsd.org
Cc:  Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd 
Date: Thu, 12 Aug 1999 15:10:12 +0200 (MET DST)

 Having considered the problem for a while, my suggestions are:

 1) I think the idea of get_myaddress is to return the IP address
 of an active interface, regardless of higher level services
 (e.g. DNS). With multiple IP addresses per machine things start
 to get complicated. Under some circumstances you would want the
 IP address most suited for the client -- usually in the clients
 subnet. get_myaddress can't do that.

 2) for compatibility reasons leave get_myaddress the way it was in
 NetBSD 1.3 (sun rpc compatible). But don't use it in regular
 NetBSD code.

 2) change the code, where get_myaddress is used with the NetBSD
 1.4 semantics to use the loopback address directly (about 3
 places). (A function, which returns the loopback address does
 not seem to be necessary).

 3) The perfect solution for rpc.bootparamd would be to
 go through the list of all active interfaces and take the one
 in the subnet of the client. This is certainly the most
 complicated -- I think the solution you proposed is good
 enough.

 Jürgen Weiß

 -- 
 Juergen Weiss		| Universitaet Mainz, Zentrum f"ur Datenverarbeitung,
 weiss@uni-mainz.de      | 55099 Mainz, Tel: 06131/39-6361, FAX: 06131/39-6407
State-Changed-From-To: open->feedback 
State-Changed-By: itojun 
State-Changed-When: Fri Apr 14 05:14:46 PDT 2000 
State-Changed-Why:  
usr.sbin/rpc.bootparamd/bootparamd.c, 1.21 -> 1.22 addresses the issue. 
please test. 

From: "Erik E. Fair" <fair@clock.org>
To: NetBSD GNATS Bug Tracking System <gnats-bugs@netbsd.org>
Cc:  
Subject: Re: bin/8119
Date: Wed, 28 Jun 2000 15:56:43 -0700

 It's been two months since the fix was committed; has it been tested?

 Also, NetBSD's RPC implementation was recently replaced; has that 
 been tested for this problem?

 	looking for PR's to close,

 	Erik <fair@clock.org>
Responsible-Changed-From-To: bin-bug-people->drochner 
Responsible-Changed-By: fair 
Responsible-Changed-When: Fri Jan 4 18:42:51 PST 2002 
Responsible-Changed-Why:  
Can you follow up on this one, please? 

From: Juergen Weiss <weiss@uni-mainz.de>
To: <gnats-bugs@netbsd.org>
Cc:  
Subject: Re: bin/8119
Date: 25 Mar 2002 11:09:57 +0100

 I checked with NetBSD 1.5.3_RC1. This problem is fixed
 there. I can netboot solaris from a NetBSD server.

 Juergen Weiss

 -- 
 Juergen Weiss	  | Universitaet Mainz, Zentrum fuer Datenverarbeitung,
 weiss@uni-mainz.de| 55099 Mainz, Tel: +49(6131)39-26361, FAX: +49(6131)39-26407

From: Juergen Weiss <weiss@uni-mainz.de>
To: <gnats-bugs@netbsd.org>
Cc:  
Subject: Re: bin/8119
Date: 25 Mar 2002 11:11:47 +0100

 I checked with NetBSD 1.5.3_RC1. This problem is fixed
 there. I can netboot solaris from a NetBSD server.

 Juergen Weiss

 -- 
 Juergen Weiss	  | Universitaet Mainz, Zentrum fuer Datenverarbeitung,
 weiss@uni-mainz.de| 55099 Mainz, Tel: +49(6131)39-26361, FAX: +49(6131)39-26407

From: Matthias Drochner <M.Drochner@fz-juelich.de>
To: Juergen Weiss <weiss@uni-mainz.de>
Cc: gnats-bugs@netbsd.org, releng-1-4@netbsd.org
Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd
Date: Mon, 25 Mar 2002 11:42:35 +0100

 weiss@uni-mainz.de said:
 >  I checked with NetBSD 1.5.3_RC1. This problem is fixed
 >  there. I can netboot solaris from a NetBSD server. 

 The fix is in
 usr.sbin/rpc.bootparamd/bootparamd.c, rev 1.22,
 which is between the 1.4 and the 1.5 branch points.

 The original PR refers to NetBSD 1.4, so I suppose it should
 be pulled up.
 I don't have a 1.4 system anymore, can someone test it?

 best regards
 Matthias



From: Juergen Weiss <weiss@uni-mainz.de>
To: M.Drochner@fz-juelich.de
Cc: gnats-bugs@netbsd.org, releng-1-4@netbsd.org
Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd
Date: 10 Apr 2002 20:45:48 +0200

 Matthias Drochner <M.Drochner@fz-juelich.de> writes:

 > weiss@uni-mainz.de said:
 > >  I checked with NetBSD 1.5.3_RC1. This problem is fixed
 > >  there. I can netboot solaris from a NetBSD server. 
 > 
 > The fix is in
 > usr.sbin/rpc.bootparamd/bootparamd.c, rev 1.22,
 > which is between the 1.4 and the 1.5 branch points.
 > 
 > The original PR refers to NetBSD 1.4, so I suppose it should
 > be pulled up.
 > I don't have a 1.4 system anymore, can someone test it?

 Sorry, I don't have a 1.4 system either. Quite a while ago
 I think I tested the patch with some version of NetBSD 1.4
 and it worked.

 Juergen

 -- 
 Juergen Weiss	  | Universitaet Mainz, Zentrum fuer Datenverarbeitung,
 weiss@uni-mainz.de| 55099 Mainz, Tel: +49(6131)39-26361, FAX: +49(6131)39-26407

From: Havard Eidnes <he@netbsd.org>
To: M.Drochner@fz-juelich.de
Cc: weiss@uni-mainz.de, gnats-bugs@netbsd.org, releng-1-4@netbsd.org
Subject: Re: bin/8119: change in get_myaddress breaks rpc.bootparamd
Date: Thu, 27 Jun 2002 00:15:20 +0200 (CEST)

 > The fix is in
 > usr.sbin/rpc.bootparamd/bootparamd.c, rev 1.22,
 > which is between the 1.4 and the 1.5 branch points.
 >
 > The original PR refers to NetBSD 1.4, so I suppose it should
 > be pulled up.
 > I don't have a 1.4 system anymore, can someone test it?

 The trivial thing, ignoring the <ifaddr.h> patch which was rejected,
 and which doesn't exist on the netbsd-1-4 branch produced a non-
 compiling program, so more than just pulling that revision up is going
 to be needed if we're to fix this on the netbsd-1-4 branch.

 Regards,

 - H=E5vard
State-Changed-From-To: feedback->closed 
State-Changed-By: perry 
State-Changed-When: Fri Apr 4 12:32:12 PST 2003 
State-Changed-Why:  
The problem is long since fixed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.