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

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265484

Jérémie Jourdin <jeremie.jourdin@advens.fr> changed:

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

--- Comment #7 from Jérémie Jourdin <jeremie.jourdin@advens.fr> ---
(In reply to Mark Johnston from comment #6)

Hello, 

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 kernel :
the mrsas driver source code has not been modified to deal with these options.
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 patch or
anything, do not hesitate.

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

help

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