Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jun 2017 11:49:18 +0800
From:      Jia-Ju Bai <baijiaju1990@163.com>
To:        freebsd-drivers@freebsd.org
Subject:   [Bug 220095] [scsi] sys/dev/dpt/dpt_scsi.c: a sleep-under-mutex bug in dpt_init
Message-ID:  <a06eb4f7-5fc5-ef2d-2bd5-efa3d8a06e89@163.com>

next in thread | raw e-mail | index | archive | help
The driver may sleep under a mutex, and the function call path in file 
"sys/dev/dpt/dpt_scsi.c" in FreeBSD 11.0 is:
dpt_init [line 1246: acquire the mutex]
   dptallocsgmap [line 1282]
     bus_dmamap_load(BUS_DMA_WAITOK) [line 323] --> may sleep

The possible fix of this bug is to set the last parameter in 
bus_dmamap_load to "BUS_DMA_NOWAIT".

This bug is found by a static analysis tool written by myself, and it is 
checked by my review of the FreeBSD code.

Thanks,
Jia-Ju Bai




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a06eb4f7-5fc5-ef2d-2bd5-efa3d8a06e89>