NetBSD Problem Report #49842

From www@NetBSD.org  Thu Apr 16 14:21:42 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D41A4A6562
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 16 Apr 2015 14:21:41 +0000 (UTC)
Message-Id: <20150416142140.DBFC5A65C7@mollari.NetBSD.org>
Date: Thu, 16 Apr 2015 14:21:40 +0000 (UTC)
From: prlw1@cam.ac.uk
Reply-To: prlw1@cam.ac.uk
To: gnats-bugs@NetBSD.org
Subject: lock assert when reloading opencrypto module
X-Send-Pr-Version: www-1.0

>Number:         49842
>Category:       kern
>Synopsis:       lock assert when reloading opencrypto module
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 16 14:25:00 +0000 2015
>Closed-Date:    Mon Jan 11 02:18:11 +0000 2016
>Last-Modified:  Mon Jan 11 02:18:11 +0000 2016
>Originator:     Patrick Welche
>Release:        NetBSD-7.99.9/amd64
>Organization:
>Environment:
>Description:
loading, unloading, and loading the opencrypto module caused a laptop to spontaneously switch off. Running a LOCKDEBUG kernel on another machine and repeating the experiment reveals:

  Mutex error: lockdebug_alloc: already initialized
>How-To-Repeat:
Build a kernel without IPSEC, hifn, ubsec, crypto, swcrypto and with LOCKDEBUG.

modstat | grep crypt    shows nothing
modload opencrypto
modunload opencrypto
modload opencrypto      panics

(As to why bother - mysteriously trying out opencrypto's compression in a rump kernel, gives a sigsegv in net/zlib.c, but not when running an ordinary swcrypto builtin kernel, so attempted to use modules to ease debugging...)
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Fri, 27 Nov 2015 23:50:23 +0000
Responsible-Changed-Why:
I'm looking into it.  (I think I'm the one who created this module!)


From: "Paul Goyette" <pgoyette@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49842 CVS commit: src/sys/opencrypto
Date: Sat, 28 Nov 2015 03:06:46 +0000

 Module Name:	src
 Committed By:	pgoyette
 Date:		Sat Nov 28 03:06:46 UTC 2015

 Modified Files:
 	src/sys/opencrypto: crypto.c cryptodev.h

 Log Message:
 Re-work the module init and destroy code to allow it to be unloaded and
 then reloaded.

 Should fix PR kern/49842


 To generate a diff of this commit:
 cvs rdiff -u -r1.45 -r1.46 src/sys/opencrypto/crypto.c
 cvs rdiff -u -r1.25 -r1.26 src/sys/opencrypto/cryptodev.h

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

State-Changed-From-To: open->feedback
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Sat, 28 Nov 2015 03:13:49 +0000
State-Changed-Why:
Fix was committed - waiting for originator to confirm.


State-Changed-From-To: feedback->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Mon, 11 Jan 2016 02:18:11 +0000
State-Changed-Why:
the bug is gone.


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