Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2023 16:59:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 265484] Adding INVARIANTS to GENERIC 13.1 kernel causes panic in mrsas
Message-ID:  <bug-265484-227-cRQFV2v4Sq@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-265484-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-265484-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265484

J=C3=A9r=C3=A9mie Jourdin <jeremie.jourdin@advens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeremie.jourdin@advens.fr

--- Comment #7 from J=C3=A9r=C3=A9mie Jourdin <jeremie.jourdin@advens.fr> -=
--
(In reply to Mark Johnston from comment #6)

Hello,=20

I faced the same issue running HardenedBSD (13-stable and current) on a HP
Server DL360 Gen 10 plus with BROADCOM AERO-10E2 SAS Raid Controller. kernel
panic occurs as soon as a write access is attempted on /dev/da0.

So I decided to test on FreeBSD and I can confirm that :
 - On FreeBSD-13.2-RC3 -> it works
 - On FreeBSD-14.0-CURRENT -> kernel panic

According to me this problem is related to the "INVARIANTS" options in kern=
el :
the mrsas driver source code has not been modified to deal with these optio=
ns.
kernel panic occurs when trying to unlock the "sim_lock" mutex.

With a custom GENERIC kernel without these options (tested on HardenedBSD),=
 it
works.

As a proof of concept, I patched sys/kern/kern_mutex.c to not panic in case=
 of
wrong assertion (!mtx_owned(m)) on the mutex "mrsas_sim_lock" used in
sys/dev/mrsas/mrsas.c. With this workaround in place, even with INVARIANTS
options, no problem with mrsas driver anymore.

Hope it can help to fix this issue, I would be happy to help testing a patc=
h or
anything, do not hesitate.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-265484-227-cRQFV2v4Sq>