NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/56170: NFS+gcc-ASAN-related: panic: lock error: Mutex: mutex_vector_enter,543: locking against myself
The following reply was made to PR kern/56170; it has been noted by GNATS.
From: "Greg A. Woods" <woods%planix.ca@localhost>
To: NetBSD GNATS <gnats-bugs%NetBSD.org@localhost>
Cc:
Subject: Re: kern/56170: NFS+gcc-ASAN-related: panic: lock error: Mutex: mutex_vector_enter,543: locking against myself
Date: Sun, 16 May 2021 22:50:32 -0700
--pgp-sign-Multipart_Sun_May_16_22:50:08_2021-1
Content-Type: text/plain; charset=US-ASCII
At Sat, 15 May 2021 09:05:13 +0000, Taylor R Campbell <riastradh%NetBSD.org@localhost> wrote:
Subject: Re: kern/56170: NFS+gcc-ASAN-related: panic: lock error: Mutex: mutex_vector_enter,543: locking against myself
>
> The problem here is that sysctl vm.proc.$pid.<VM_PROC_MAP> holds
> p->p_lock over vnode_to_path, which is forbidden. It should hold a
> reference that prevents the proc from going away, but not p_lock, like
> procfs_rw does in procfs_subr.c.
>
> The attached patch tries to address the issue, and should be
> pullable-up to 9 if it works, but I haven't tested it.
Yes! Thanks! This does indeed seem to fix the problem I experienced.
It took me all too much fiddly time to reproduce the bug in a Xen domU,
but after booting the patched kernel I was able to run my test in a loop
for nearly 24 hours without any crash or any other noticeable problem.
(there was not much other activity, except /etc/daily I guess)
> (That said, this code is grody, and we should factor out the common
> parts this less grodily. It looks like sysctl proc.$pid.cwd might
> have the same issue -- fill_cwd in sys/kern/kern_proc.c.)
Indeed.
The other hack Christos mentioned covers only one of what look like many
similar code paths in the NFS code, so either the fix is very incomplete
or else the problem is similarly elsewhere.
--
Greg A. Woods <gwoods%acm.org@localhost>
Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>
--pgp-sign-Multipart_Sun_May_16_22:50:08_2021-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
Content-Description: OpenPGP Digital Signature
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRuK6dmwVAucmRxuh9mfXG3eL/0fwUCYKIEFAAKCRBmfXG3eL/0
f7/3AJ0anptkEwEpmkbHHEivsmZUbVRwCwCeJ4B3tkQcqFFL4Sx5cLx3nM9D75w=
=PZ/e
-----END PGP SIGNATURE-----
--pgp-sign-Multipart_Sun_May_16_22:50:08_2021-1--
Home |
Main Index |
Thread Index |
Old Index