Skip to content

Commit

Permalink
HBSD MFC: iscsi_initiator(4): Fix use-after-free, double-free
Browse files Browse the repository at this point in the history
ism_stop() already destroys and frees 'sp', including a call to ic_destroy().
Don't dereference 'sp' after ism_stop() and don't invoke ic_destroy() on the
freed memory either.

Reported by:	Coverity
CIDs:		1006109, 1304861
Sponsored by:	EMC / Isilon Storage Division

(cherry picked from commit c882214)
  • Loading branch information
cemeyer authored and opntr committed Apr 26, 2016
1 parent d52ff49 commit d4b3b90
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sys/dev/iscsi_initiator/iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,6 @@ iscsi_stop(void)
TAILQ_FOREACH_SAFE(sp, &isc->isc_sess, sp_link, sp_tmp) {
//XXX: check for activity ...
ism_stop(sp);
if(sp->cam_sim != NULL)
ic_destroy(sp);
}
mtx_destroy(&isc->isc_mtx);
sx_destroy(&isc->unit_sx);
Expand Down

0 comments on commit d4b3b90

Please sign in to comment.