Blame SOURCES/0024-iscsistart-fix-null-pointer-deref-before-exit.patch

5ff713
From b9bf7cea4769efa73e6de9b13a8d1833d2ac3d92 Mon Sep 17 00:00:00 2001
5ff713
From: Chris Leech <cleech@redhat.com>
5ff713
Date: Wed, 16 Jun 2021 09:55:06 -0700
5ff713
Subject: [PATCH 1/1] iscsistart: fix null pointer deref before exit
5ff713
5ff713
Fixes regression caused by "open-iscsi: Clean user_param list when
5ff713
process exit"  Which is a shame, as not freeing a memory at process exit
5ff713
doesn't really hurt anything.
5ff713
5ff713
Same change as "Fix iscsiadm segfault when exiting" applied to iscsiadm.
5ff713
5ff713
Fixes: b532ad67d495d42026165a26515c645995d23f18
5ff713
Signed-off-by: Chris Leech <cleech@redhat.com>
5ff713
---
5ff713
 usr/iscsistart.c | 4 ++--
5ff713
 1 file changed, 2 insertions(+), 2 deletions(-)
5ff713
5ff713
diff --git a/usr/iscsistart.c b/usr/iscsistart.c
5ff713
index 206cd4c..7eb573e 100644
5ff713
--- a/usr/iscsistart.c
5ff713
+++ b/usr/iscsistart.c
5ff713
@@ -361,7 +361,7 @@ int main(int argc, char *argv[])
5ff713
 	struct boot_context *context, boot_context;
5ff713
 	struct sigaction sa_old;
5ff713
 	struct sigaction sa_new;
5ff713
-	struct user_param *param;
5ff713
+	struct user_param *param, *tmp_param;
5ff713
 	int control_fd, mgmt_ipc_fd, err;
5ff713
 	pid_t pid;
5ff713
 
5ff713
@@ -556,7 +556,7 @@ int main(int argc, char *argv[])
5ff713
 	mgmt_ipc_close(mgmt_ipc_fd);
5ff713
 	free_initiator();
5ff713
 	sysfs_cleanup();
5ff713
-	list_for_each_entry(param, &user_params, list) {
5ff713
+	list_for_each_entry_safe(param, tmp_param, &user_params, list) {
5ff713
 		list_del(&param->list);
5ff713
 		idbm_free_user_param(param);
5ff713
 	}
5ff713
-- 
5ff713
2.31.1
5ff713