mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
scsi: bfa: Double-free fix
[ Upstream commit add4c48503 ]
When the bfad_im_probe() function fails during initialization, the memory
pointed to by bfad->im is freed without setting bfad->im to NULL.
Subsequently, during driver uninstallation, when the state machine enters
the bfad_sm_stopping state and calls the bfad_im_probe_undo() function,
it attempts to free the memory pointed to by bfad->im again, thereby
triggering a double-free vulnerability.
Set bfad->im to NULL if probing fails.
Signed-off-by: jackysliu <1972843537@qq.com>
Link: https://lore.kernel.org/r/tencent_3BB950D6D2D470976F55FC879206DE0B9A09@qq.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f5de907f04
commit
ba024d9256
@@ -707,6 +707,7 @@ bfad_im_probe(struct bfad_s *bfad)
|
||||
|
||||
if (bfad_thread_workq(bfad) != BFA_STATUS_OK) {
|
||||
kfree(im);
|
||||
bfad->im = NULL;
|
||||
return BFA_STATUS_FAILED;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user