diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-01-02 13:10:33 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-01-02 13:10:33 +0000 |
commit | c81bb57ba0bb9563541505b3d7180013a36ed87f (patch) | |
tree | c521b44dadc35e93e96b149bf0779552f1e84d48 /sys/kern/kern_cons.c | |
parent | 71fae7c995bce4d35d79bbfc01ad02b3eb5429e7 (diff) | |
download | FreeBSD-src-c81bb57ba0bb9563541505b3d7180013a36ed87f.zip FreeBSD-src-c81bb57ba0bb9563541505b3d7180013a36ed87f.tar.gz |
The "cnputs_mtx" mutex must be allowed to recurse. Debug prints and/or
witness printouts in the console driver clients can cause this mutex
to recurse by calls to "printf()" from witness for example. In
particular this can happen if "debug.witness.skipspin=0" is set in the
boot environment.
MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_cons.c')
-rw-r--r-- | sys/kern/kern_cons.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index bbc0e51..75f9c18 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -601,7 +601,13 @@ static void cn_drvinit(void *unused) { - mtx_init(&cnputs_mtx, "cnputs_mtx", NULL, MTX_SPIN | MTX_NOWITNESS); + /* + * NOTE: Debug prints and/or witness printouts in console + * driver clients can cause the "cnputs_mtx" mutex to + * recurse. Make sure the "MTX_RECURSE" flags is set! + */ + mtx_init(&cnputs_mtx, "cnputs_mtx", NULL, MTX_SPIN | + MTX_NOWITNESS | MTX_RECURSE); use_cnputs_mtx = 1; } |