Home
last modified time | relevance | path

Searched hist:b592211c33f745af67a3271ce77c10fc1e6d6241 (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/md/
H A Ddm-mpath.cdiff b592211c33f745af67a3271ce77c10fc1e6d6241 Mon Sep 17 10:38:47 CDT 2018 Mike Snitzer <snitzer@redhat.com> dm mpath: fix attached_handler_name leak and dangling hw_handler_name pointer

Commit e8f74a0f0011 ("dm mpath: eliminate need to use
scsi_device_from_queue") introduced 2 regressions:
1) memory leak occurs if attached_handler_name is not assigned to
m->hw_handler_name
2) m->hw_handler_name can become a dangling pointer if the
RETAIN_ATTACHED_HW_HANDLER flag is set and scsi_dh_attach() returns
-EBUSY.

Fix both of these by clearing 'attached_handler_name' pointer passed to
setup_scsi_dh() after it is assigned to m->hw_handler_name. And if
setup_scsi_dh() doesn't consume 'attached_handler_name' parse_path()
will kfree() it.

Fixes: e8f74a0f0011 ("dm mpath: eliminate need to use scsi_device_from_queue")
Cc: stable@vger.kernel.org # 4.16+
Reported-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>