NetBSD Problem Report #51079

From john@lappie.zia.io  Wed Apr 20 21:37:09 2016
Return-Path: <john@lappie.zia.io>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0B3A17A13C
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 20 Apr 2016 21:37:09 +0000 (UTC)
Message-Id: <20160420213707.1DFC9CD332A@lappie.zia.io>
Date: Wed, 20 Apr 2016 21:37:07 +0000 (UTC)
From: john@ziaspace.com
Reply-To: john@ziaspace.com
To: gnats-bugs@NetBSD.org
Subject: Accessing unconfigured cgd causes panic
X-Send-Pr-Version: 3.95

>Number:         51079
>Category:       kern
>Synopsis:       Accessing unconfigured cgd causes panic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 20 21:40:00 +0000 2016
>Last-Modified:  Thu Apr 21 14:15:01 +0000 2016
>Originator:     John Klos
>Release:        NetBSD 7.99.26
>Organization:

>Environment:


System: NetBSD lappie.zia.io 7.99.26 NetBSD 7.99.26 (GENERIC.201603151930Z) amd64
Architecture: x86_64
Machine: amd64
>Description:

Use cgdconfig to configure a cgd device, then cgdconfig -u that device.
Accidentally try to access that unconfigured cgd device (disklabel cgd0, for
instance), and the machine panics.
Was not able to get a picture of the screen before reboot, but it said something about
a divide by zero error.
>How-To-Repeat:

See Description.
>Fix:

Not know.

>Audit-Trail:
From: John Klos <john@ziaspace.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/51079: Accessing unconfigured cgd causes panic
Date: Wed, 20 Apr 2016 23:44:37 +0000 (UTC)

 More information:

 This doesn't happen with a properly configured cgd. I get "DIOCGDINFO: 
 Device not configured". So this only happens when you disklabel a device 
 and put the first 4.2BSD partition at the beginning of a disk instead of 
 32 blocks (or however many - don't know what the threshold is) away from 
 the beginning. After running cgdconfig, attempts to access the cgd give a 
 write error. After running cgdconfig -u and trying to access the cgd, the 
 machine panics.

 It might be worth mentioning in the documentation that full disk 
 encryption can't be used by specifying a disklabel slice which covers the 
 whole disk.

From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/51079: Accessing unconfigured cgd causes panic
Date: Thu, 21 Apr 2016 05:58:33 +0000 (UTC)

 john@ziaspace.com (John Klos) writes:

 > write error. After running cgdconfig -u and trying to access the cgd, the 
 > machine panics.

 When I try this I get

 # cgdconfig -V re-enter cgd0 /dev/vnd0a
 /dev/vnd0a's passphrase:
 re-enter device's passphrase:
 # cgdconfig -u cgd0
 # disklabel cgfd0
 disklabel: ioctl DIOCGDINFO: Device not configured

 -- 
 -- 
                                 Michael van Elst
 Internet: mlelstv@serpens.de
                                 "A potential Snark may lurk in every tree."

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, john@ziaspace.com
Cc: 
Subject: Re: kern/51079: Accessing unconfigured cgd causes panic
Date: Thu, 21 Apr 2016 10:12:55 -0400

 On Apr 21, 12:00am, john@ziaspace.com (John Klos) wrote:
 -- Subject: Re: kern/51079: Accessing unconfigured cgd causes panic

 | The following reply was made to PR kern/51079; it has been noted by GNATS.
 | 
 | From: John Klos <john@ziaspace.com>
 | To: gnats-bugs@NetBSD.org
 | Cc: 
 | Subject: Re: kern/51079: Accessing unconfigured cgd causes panic
 | Date: Wed, 20 Apr 2016 23:44:37 +0000 (UTC)
 | 
 |  More information:
 |  
 |  This doesn't happen with a properly configured cgd. I get "DIOCGDINFO: 
 |  Device not configured". So this only happens when you disklabel a device 
 |  and put the first 4.2BSD partition at the beginning of a disk instead of 
 |  32 blocks (or however many - don't know what the threshold is) away from 
 |  the beginning. After running cgdconfig, attempts to access the cgd give a 
 |  write error. After running cgdconfig -u and trying to access the cgd, the 
 |  machine panics.
 |  
 |  It might be worth mentioning in the documentation that full disk 
 |  encryption can't be used by specifying a disklabel slice which covers the 
 |  whole disk.

 We should fix the panic anyway...

 christos

>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.