[Pkg-iscsi-maintainers] [open-iscsi] 01/33: iscsid: fix iscsid segfault during qla4xxx login

Ritesh Raj Sarraf rrs at alioth.debian.org
Tue Nov 5 16:21:09 UTC 2013


This is an automated email from the git hooks/post-receive script.

rrs pushed a commit to branch upstream-mnc
in repository open-iscsi.

commit 71cd021b74a7094b5186a42bfe59a35e2fa66018
Author: Mike Christie <michaelc at cs.wisc.edu>
Date:   Wed Sep 5 16:18:16 2012 -0500

    iscsid: fix iscsid segfault during qla4xxx login
    
    If the kernel sends multiple ISCSI_KEVENT_CONN_LOGIN_STATE
    events for the same login event iscsid will segault.
    
    When we get a conn error we will set the r_stage to reopen, then when
    session_conn_process_login handles the first login event we set the r_stage
    to R_STAGE_NO_CHANGE. But then it looks like if we get a second login event
    r_stage is no_change and session_conn_process_login will run again and
    call mgmt_ipc_write_rsp on a bad qtask.
---
 usr/initiator.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/usr/initiator.c b/usr/initiator.c
index 79ca32c..d475358 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -993,7 +993,7 @@ static void session_scan_host(struct iscsi_session *session, int hostno,
 		exit(0);
 	} else if (pid > 0) {
 		reap_inc();
-		if (qtask) {
+		if (qtask && qtask->mgmt_ipc_fd >= 0) {
 			close(qtask->mgmt_ipc_fd);
 			free(qtask);
 		}
@@ -1618,6 +1618,9 @@ static void session_conn_process_login(void *data)
 	if (state == ISCSI_CONN_STATE_FREE)
 		goto failed_login;
 
+	if (conn->state == ISCSI_CONN_STATE_LOGGED_IN)
+		return;
+
 	conn->state = ISCSI_CONN_STATE_LOGGED_IN;
 	/*
 	 * ok we were in_login and now we got the notification that we are

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-iscsi/open-iscsi.git



More information about the Pkg-iscsi-maintainers mailing list