NetBSD Problem Report #12506

Received: (qmail 22882 invoked from network); 29 Mar 2001 23:50:41 -0000
Message-Id: <20010329235040.7BE551110F@www.netbsd.org>
Date: Thu, 29 Mar 2001 15:50:40 -0800 (PST)
From: anne@alcor.concordia.ca
Sender: nobody@netbsd.org
Reply-To: anne@alcor.concordia.ca
To: gnats-bugs@gnats.netbsd.org
Subject: Request: password for input in bootselect
X-Send-Pr-Version: www-1.0

>Number:         12506
>Category:       port-i386
>Synopsis:       Request: password for input in bootselect
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 29 23:51:00 +0000 2001
>Closed-Date:    Sat Apr 07 11:11:10 +0000 2001
>Last-Modified:  Sat Apr 07 11:11:10 +0000 2001
>Originator:     Anne Bennett
>Release:        1.5
>Organization:
Concordia University
>Environment:
NetBSD eridani.concordia.ca 1.5 NetBSD 1.5 (ERIDANI) #1: Tue Mar 20 15:48:34 EST 2001     anne@eridani.concordia.ca:/big/sources/usr/src/sys/arch/i386/compile/ERIDANI i386

>Description:
I'm trying to set my machine so that it can boot unattended from
the default device and file, but so that some kind of authentication
is required before it is possible to specify different boot parameters.
I was hoping to find something in bootselect (the special MBR), but
according to the documentation there, there is no such facility.

I am of course aware that certain restrictions can be implemented via
the PROM settings (though every motherboard is different, it seems!),
and I'm also aware that once someone has physical access to the machine,
there is in the end no limit to what they can do, given time or the
willingness to walk away with the disk.  However, the facility I
request would greatly restrict the circumstances under which someone
could tamper with my machine, and so would be much appreciated.
>How-To-Repeat:
N/A
>Fix:
I'm told that LILO can do this...
>Release-Note:
>Audit-Trail:

From: Antti Kantee <pooka@iki.fi>
To: anne@alcor.concordia.ca
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Fri, 30 Mar 2001 18:35:47 +0300

 On Thu Mar 29 2001 at 15:50:40 -0800, anne@alcor.concordia.ca wrote:
 > I'm trying to set my machine so that it can boot unattended from
 > the default device and file, but so that some kind of authentication
 > is required before it is possible to specify different boot parameters.
 > I was hoping to find something in bootselect (the special MBR), but
 > according to the documentation there, there is no such facility.
 > 
 > I am of course aware that certain restrictions can be implemented via
 > the PROM settings (though every motherboard is different, it seems!),
 > and I'm also aware that once someone has physical access to the machine,
 > there is in the end no limit to what they can do, given time or the
 > willingness to walk away with the disk.  However, the facility I
 > request would greatly restrict the circumstances under which someone
 > could tamper with my machine, and so would be much appreciated.

 installboot(8):
      -p password
            If supported by the boot program, set the password which must be
            entered before the boot menu can be accessed.

 -- 
 Antti Kantee <pooka@iki.fi>          v          Of course he runs NetBSD
 http://www.iki.fi/pooka/             i            http://www.NetBSD.org/

From: Anne Bennett <anne@alcor.concordia.ca>
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Cc:  
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Fri, 30 Mar 2001 17:58:18 -0500

 I asked:

 >> I'm trying to set my machine so that it can boot unattended from
 >> the default device and file, but so that some kind of authentication
 >> is required before it is possible to specify different boot parameters.
 >> I was hoping to find something in bootselect (the special MBR), but
 >> according to the documentation there, there is no such facility.

 and Antti Kantee <pooka@iki.fi> suggested:

 > installboot(8):
 >      -p password
 >            If supported by the boot program, set the password which must be
 >            entered before the boot menu can be accessed.

 My immediate reaction was embarrassment that I had somehow missed
 that, since I thought I had read all of the manpages suggested by
 "apropos boot".

 Anyway, I tried this:

 /usr/mdec/installboot -v -t 5 -p PASSWORD /usr/mdec/biosboot.sym /dev/rsd0a

 and the command responded (after its other verbosity):

 installboot: no password support in bootblock


 ... so I'm still stuck.  :-(


 Anne.
 -- 
 Ms. Anne Bennett, Senior Analyst, IITS, Concordia University, Montreal H3G 1M8
 anne@alcor.concordia.ca                                        +1 514 848-7606

From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
To: Anne Bennett <anne@alcor.concordia.ca>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Sat, 31 Mar 2001 01:06:52 +0200 (MET DST)

 On Fri, 30 Mar 2001, Anne Bennett wrote:
 > installboot: no password support in bootblock

 cd /sys/arch/i386/stand/biosboot, edit the Makefile to build with
 BOOTPASSWD, rebuild. 

 I have not tried this - someone mentioned that there may be a size issue
 in the current bootblock code. Maybe let us know if this works or not.


  - Hubert

 -- 
 Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>


From: Anne Bennett <anne@alcor.concordia.ca>
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Cc:  
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Fri, 30 Mar 2001 18:24:58 -0500

 Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de> suggests:

 >> installboot: no password support in bootblock
 > 
 > cd /sys/arch/i386/stand/biosboot, edit the Makefile to build with
 > BOOTPASSWD, rebuild. 
 > 
 > I have not tried this - someone mentioned that there may be a size issue
 > in the current bootblock code. Maybe let us know if this works or not.

 I'll be happy to try this (on Monday), if I can do it without risking
 trashing that system.  I don't mind risking having to boot from floppy
 to install a good bootblock if my attempt results in an unusable one,
 but is there any chance that, if the resulting code is too big, part of
 my root partition will be overwritten?

 If so, I'll have to delay the test until I can do it on a play system.


 Anne.
 -- 
 Ms. Anne Bennett, Senior Analyst, IITS, Concordia University, Montreal H3G 1M8
 anne@alcor.concordia.ca                                        +1 514 848-7606

From: "Charles M. Hannum" <abuse@ihack.net>
To: Anne Bennett <anne@alcor.concordia.ca>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Fri, 30 Mar 2001 15:34:21 -0800

 On Fri, Mar 30, 2001 at 06:24:58PM -0500, Anne Bennett wrote:
 > 
 > Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de> suggests:
 > 
 > >> installboot: no password support in bootblock
 > > 
 > > cd /sys/arch/i386/stand/biosboot, edit the Makefile to build with
 > > BOOTPASSWD, rebuild. 
 > > 
 > > I have not tried this - someone mentioned that there may be a size issue
 > > in the current bootblock code. Maybe let us know if this works or not.
 > 
 > I'll be happy to try this (on Monday), if I can do it without risking
 > trashing that system.  I don't mind risking having to boot from floppy
 > to install a good bootblock if my attempt results in an unusable one,
 > but is there any chance that, if the resulting code is too big, part of
 > my root partition will be overwritten?

 No; most of the boot block is actually installed through the file
 system; only the first sector is written `the hard way', and always at
 the beginning of the partition.  installboot(8) will complain if there
 are too many sectors.

 If it turns out to be too big, you can always remove some features.
 E.g., SA_USE_CREAD=yes is only necessary to boot gzipped kernels, which
 you probably don't need to do.


From: Antti Kantee <pooka@iki.fi>
To: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
Cc: Anne Bennett <anne@alcor.concordia.ca>, gnats-bugs@gnats.netbsd.org,
        netbsd-bugs@netbsd.org
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Sat, 31 Mar 2001 11:51:17 +0300

 On Sat Mar 31 2001 at 01:06:52 +0200, Hubert Feyrer wrote:
 > On Fri, 30 Mar 2001, Anne Bennett wrote:
 > > installboot: no password support in bootblock
 > 
 > cd /sys/arch/i386/stand/biosboot, edit the Makefile to build with
 > BOOTPASSWD, rebuild. 
 > 
 > I have not tried this - someone mentioned that there may be a size issue
 > in the current bootblock code. Maybe let us know if this works or not.

 Come to think of it, that was me. IIRC the bootblock compiled with
 -DBOOTPASSWD just reset the machine instead of booting anything. I don't
 think I ever did anything about it, simply just removed the bootmenu
 from the code alltogether.

 -- 
 Antti Kantee <pooka@iki.fi>          v          Of course he runs NetBSD
 http://www.iki.fi/pooka/             i            http://www.NetBSD.org/

From: Anne Bennett <anne@alcor.concordia.ca>
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Cc:  
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Wed, 04 Apr 2001 17:53:09 -0400

 Well, it didn't work. :-(   Details below.

 AB = Anne Bennett <anne@alcor.concordia.ca>
 HF = Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
 AK = Antti Kantee <pooka@iki.fi>

 AB> installboot: no password support in bootblock

 HF> cd /sys/arch/i386/stand/biosboot, edit the Makefile to build with
 HF> BOOTPASSWD, rebuild. 
 HF> 
 HF> I have not tried this - someone mentioned that there may be a size issue
 HF> in the current bootblock code. Maybe let us know if this works or not.

   # /usr/mdec/installboot -v -t 5 -p PASSWORD /usr/mdec/biosboot.sym /dev/rsd0a
   /usr/mdec/biosboot.sym: entry point 0x805d000
   proto bootblock size 51200
   room for 10 filesystem blocks at 0x578
   renamed //boot -> //boot.bak
   Will load 85 blocks.
   dblk: 576, num: 16
   dblk: 592, num: 16
   dblk: 608, num: 16
   dblk: 624, num: 16
   dblk: 640, num: 16
   dblk: 488, num: 5
   BSD partition starts at sector 63
   deleting //boot.bak

 AK> Come to think of it, that was me. IIRC the bootblock compiled with
 AK> -DBOOTPASSWD just reset the machine instead of booting anything. I don't
 AK> think I ever did anything about it, simply just removed the bootmenu
 AK> from the code alltogether.

 I had the same result.  More precisely:

 The boot countdown comes up.  If I strike a key, I get asked for a
 password.  If I enter an incorrect password, I simply get another
 password prompt.  If I enter the right password, I get the boot menu
 prompt.  When I typed "boot foo", it said something like "booting from
 wd0a:foo" (which puzzled me because I use sd0a), then the screen went
 blank and the machine reset.  Next time, I sat on my fingers and let
 it try to boot by itself -- it reset again.  I did not have time to
 see which device it claimed to be booting from before the screen went
 blank.

 I eventually wrestled the system back to normal.  For comparison, here
 I am installing the old boot blocks back again:

   # /usr/mdec/installboot -v -t 5 /usr/mdec/biosboot.sym /dev/rsd0a
   /usr/mdec/biosboot.sym: entry point 0x805d000
   proto bootblock size 48128
   room for 10 filesystem blocks at 0x578
   renamed //boot -> //boot.bak
   Will load 79 blocks.
   dblk: 576, num: 16
   dblk: 592, num: 16
   dblk: 608, num: 16
   dblk: 624, num: 16
   dblk: 640, num: 15
   BSD partition starts at sector 63
   deleting //boot.bak

 I hope that the above information means something to you folks; I'm
 out of my depth.


 Anne.
 -- 
 Ms. Anne Bennett, Senior Analyst, IITS, Concordia University, Montreal H3G 1M8
 anne@alcor.concordia.ca                                        +1 514 848-7606

From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
To: Anne Bennett <anne@alcor.concordia.ca>
Cc: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Thu, 5 Apr 2001 01:20:53 +0200 (MET DST)

 bad:
 >   proto bootblock size 51200
 >   Will load 85 blocks.

 good:
 >   proto bootblock size 48128
 >   Will load 79 blocks.

 I can only guess that the bootblock is too big. Have you tried rebuilding
 without SA_USE_CREAD, SA_INCLUDE_NET in
 /sys/arch/i386/stand/biosboot/Makefile?


  - Hubert

 -- 
 Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>


From: Anne Bennett <anne@alcor.concordia.ca>
To: gnats-bugs@gnats.netbsd.org, netbsd-bugs@netbsd.org
Cc:  
Subject: Re: port-i386/12506: Request: password for input in bootselect
Date: Thu, 05 Apr 2001 13:50:35 -0400

 Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de> suggests:

 > bad:
 >>   proto bootblock size 51200
 >>   Will load 85 blocks.
 > 
 > good:
 >>   proto bootblock size 48128
 >>   Will load 79 blocks.
 > 
 > I can only guess that the bootblock is too big.

 Part of me really wants to ask, "too big for what?", but there's a
 good chance I would not understand the answer and I'd hate to waste
 your time.  Anyway...

 > Have you tried rebuilding
 > without SA_USE_CREAD, SA_INCLUDE_NET in
 > /sys/arch/i386/stand/biosboot/Makefile?

 I hadn't, but today I gathered up my courage and did so.  It works!

 SA_INCLUDE_NET was already set to "no" in the Makefile, but I changed
 the setting of SA_USE_CREAD from "yes" to "no", and installed the
 resulting biosboot.sym:

   /usr/mdec/biosboot.sym: entry point 0x805d000
   proto bootblock size 30720
   room for 10 filesystem blocks at 0x578
   renamed //boot -> //boot.bak
   Will load 45 blocks.
   dblk: 9840, num: 16
   dblk: 13424, num: 16
   dblk: 482, num: 13
   BSD partition starts at sector 63
   deleting //boot.bak

 *Much* smaller, as you can see.

 Anyway, the right thing happens with respect to passwords; thanks!

 Booting from floppy is now a bit of an ordeal, since to do so, I have
 to set the hardware to boot from removable media first, so that the
 floppy's bootblocks (which understand the floppy's gzipped kernel)
 are used.  I hope that some day it will be possible to squeeze all that
 functionality (gzipped kernel reading *and* boot menu passwords) in,
 but for now, what I have is quite workable, and in particular, I think
 my system is now protected from attackers with physical access, except
 those who are actually willing to open the case and grab the disk or
 physically reset the supervisor password (or just take the whole system!).

 Again, many thanks!


 Anne.
 -- 
 Ms. Anne Bennett, Senior Analyst, IITS, Concordia University, Montreal H3G 1M8
 anne@alcor.concordia.ca                                        +1 514 848-7606
State-Changed-From-To: open->closed 
State-Changed-By: hubertf 
State-Changed-When: Sat Apr 7 04:10:41 PDT 2001 
State-Changed-Why:  

stripping down the bootblock helped 
(more data in the PR) 


- Hubert 
>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.