NetBSD Problem Report #55552

From christos@vmb1.astron.com  Sat Aug  8 17:05:08 2020
Return-Path: <christos@vmb1.astron.com>
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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 94FD01A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  8 Aug 2020 17:05:08 +0000 (UTC)
Message-Id: <20200808154843.30B1924760B@vmb1.astron.com>
Date: Sat,  8 Aug 2020 15:48:43 +0000 (UTC)
From: christos@zoulas.com
Reply-To: christos@zoulas.com
To: gnats-bugs@NetBSD.org
Subject: panic with union mount
X-Send-Pr-Version: 3.95

>Number:         55552
>Category:       kern
>Synopsis:       kernel panics with union mount
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 08 17:10:00 +0000 2020
>Closed-Date:    
>Last-Modified:  Thu Aug 27 09:10:01 +0000 2020
>Originator:     Christos Zoulas
>Release:        NetBSD 9.99.69
>Organization:
	Atom Smashing, Inc.
>Environment:
System: NetBSD vmb1.astron.com 9.99.69 NetBSD 9.99.69 (GENERIC) #83: Sat Aug 8 08:25:00 EDT 2020 christos@vmb1.astron.com:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
panic: kernel diagnostic assertion "fstrans_held(vp->v_mount)" failed: file "/p/src/sys/ufs/ufs/ufs_vnops.c", line 1873 
cpu0: Begin traceback...
vpanic() at netbsd:vpanic+0x152
__x86_indirect_thunk_rax() at netbsd:__x86_indirect_thunk_rax
ufs_strategy() at netbsd:ufs_strategy+0x1dc
VOP_STRATEGY() at netbsd:VOP_STRATEGY+0x3c
bio_doread() at netbsd:bio_doread+0x98
bread() at netbsd:bread+0x18
ffs_bufrd() at netbsd:ffs_bufrd+0x152
ufs_readdir() at netbsd:ufs_readdir+0x13e
VOP_READDIR() at netbsd:VOP_READDIR+0x4c
vn_readdir() at netbsd:vn_readdir+0xe7
sys___getdents30() at netbsd:sys___getdents30+0x72
syscall() at netbsd:syscall+0x283
--- syscall (number 390) ---
netbsd:syscall+0x283:
cpu0: End traceback...
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip 0xffffffff80221a25 cs 0x8 rflags 0x202 cr2 0x79ed49b98000 ilevel 0 rsp 0xffffbb826d284b10
curlwp 0xffffe3c9b30ab680 pid 994.994 lowest kstack 0xffffbb826d2802c0
Stopped in pid 994.994 (sh) at	netbsd:breakpoint+0x5:	leave	
?
breakpoint() at netbsd:breakpoint+0x5
vpanic() at netbsd:vpanic+0x152
__x86_indirect_thunk_rax() at netbsd:__x86_indirect_thunk_rax
ufs_strategy() at netbsd:ufs_strategy+0x1dc
VOP_STRATEGY() at netbsd:VOP_STRATEGY+0x3c
bio_doread() at netbsd:bio_doread+0x98
bread() at netbsd:bread+0x18
ffs_bufrd() at netbsd:ffs_bufrd+0x152
ufs_readdir() at netbsd:ufs_readdir+0x13e
VOP_READDIR() at netbsd:VOP_READDIR+0x4c
vn_readdir() at netbsd:vn_readdir+0xe7
sys___getdents30() at netbsd:sys___getdents30+0x72
syscall() at netbsd:syscall+0x283
--- syscall (number 390) ---
netbsd:syscall+0x283:

dumping to dev 168,4 (offset=558567, size=8318787):
dump 
--------------------------------------------------------------
>How-To-Repeat:
	union mount and then list files
>Fix:
	please

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: kern/55552: panic with union mount
Date: Sat, 8 Aug 2020 13:28:42 -0400

 --Apple-Mail=_A6762AF1-10BD-4DD0-81E2-2E5921ED299E
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=us-ascii


 The mounts were:


 /dev/dk5 on / type ffs (local)
 /dev/dk6 on /var type ffs (nosuid, local)
 /dev/dk7 on /usr type ffs (nodev, read-only, local)
 /dev/dk8 on /usr/pkg type ffs (nodev, read-only, local)
 /dev/dk9 on /usr/local type ffs (nodev, read-only, local)
 /dev/dk14 on /d type ffs (read-only, local)
 /dev/dk11 on /p type ffs (nodev, nosuid, read-only, local)
 /dev/dk13 on /r type ffs (local)
 /dev/dk12 on /s type ffs (read-only, local)
 /dev/dk10 on /u type ffs (local)
 tmpfs on /tmp type tmpfs (nodev, nosuid, local)
 tmpfs on /var/shm type tmpfs (local)
 ptyfs on /dev/pts type ptyfs (local)
 pid277@T470p:/localnet on /localnet type nfs (hidden)
 pid277@T470p:/users on /users type nfs (hidden)
 pid277@T470p:/homes on /homes type nfs (hidden)
 pid277@T470p:/local on /local type nfs (hidden)
 pid277@T470p:/l on /l type nfs (hidden)
 <above>:/u/src/sysadm/NetBSD/p/src on /p/src type union (nodev, nosuid, =
 local)

 Running

 $ /p/src/build.sh -m amd64 -a x86_64     -x -X /p/xsrc    -j 6    -T =
 /t/NetBSD.amd64-x86_64/tools    -D /t/NetBSD.amd64-x86_64/destdir    -R =
 /t/NetBSD.amd64-x86_64/release    -O /t/NetBSD.amd64-x86_64/obj release =
 started at Fri Aug  7 09:06:52 EDT 2020 ***

 from /u/src/sysadm/NetBSD/p.

 --Apple-Mail=_A6762AF1-10BD-4DD0-81E2-2E5921ED299E
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org

 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCXy7gygAKCRBxESqxbLM7
 OjZ6AJ9AJhoEIcrcW9SMGvnhS8Ul1ovGXQCfUrLSAWCPCs1d6674Ev9GafPWGLA=
 =DfvQ
 -----END PGP SIGNATURE-----

 --Apple-Mail=_A6762AF1-10BD-4DD0-81E2-2E5921ED299E--

From: "Juergen Hannken-Illjes" <hannken@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55552 CVS commit: src/sys/fs/union
Date: Tue, 18 Aug 2020 09:44:07 +0000

 Module Name:	src
 Committed By:	hannken
 Date:		Tue Aug 18 09:44:07 UTC 2020

 Modified Files:
 	src/sys/fs/union: union.h union_subr.c union_vnops.c

 Log Message:
 Operation union_readdirhook() stores the lower directory as un_uppervp.
 This breaks the assumption that un_uppervp->v_mount is the upper mount.

 Fix by storing the directory as un_lowervp and adapt union_readdir().

 Should fix PR kern/55552: panic with union mount


 To generate a diff of this commit:
 cvs rdiff -u -r1.29 -r1.30 src/sys/fs/union/union.h
 cvs rdiff -u -r1.78 -r1.79 src/sys/fs/union/union_subr.c
 cvs rdiff -u -r1.73 -r1.74 src/sys/fs/union/union_vnops.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->feedback
State-Changed-By: hannken@NetBSD.org
State-Changed-When: Tue, 18 Aug 2020 10:59:53 +0000
State-Changed-Why:
Submitted a fix -- please confirm.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55552 CVS commit: [netbsd-9] src/sys/fs/union
Date: Thu, 27 Aug 2020 09:08:40 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Thu Aug 27 09:08:39 UTC 2020

 Modified Files:
 	src/sys/fs/union [netbsd-9]: union.h union_subr.c union_vnops.c

 Log Message:
 Pull up following revision(s) (requested by hannken in ticket #1062):

 	sys/fs/union/union.h: revision 1.30
 	sys/fs/union/union_subr.c: revision 1.79
 	sys/fs/union/union_vnops.c: revision 1.74

 Operation union_readdirhook() stores the lower directory as un_uppervp.
 This breaks the assumption that un_uppervp->v_mount is the upper mount.

 Fix by storing the directory as un_lowervp and adapt union_readdir().

 Should fix PR kern/55552: panic with union mount


 To generate a diff of this commit:
 cvs rdiff -u -r1.29 -r1.29.10.1 src/sys/fs/union/union.h
 cvs rdiff -u -r1.77 -r1.77.8.1 src/sys/fs/union/union_subr.c
 cvs rdiff -u -r1.70 -r1.70.14.1 src/sys/fs/union/union_vnops.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.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.