fix libiscsi regression causing faults in udisksd during iscsi firmware discovery

This commit is contained in:
Chris Leech 2022-06-15 15:34:17 -07:00
parent c880c4d7fd
commit cea269fd62
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,40 @@
From 47dd191ab5c48932df4c0c219fca19fcedba6cd2 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 2 Jun 2022 11:37:20 -0700
Subject: [PATCH 1/1] fix libiscsi firmware discovery issue with NULL drec
argument
---
libiscsi/libiscsi.c | 2 +-
usr/idbm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
index c598aee..bddf9fc 100644
--- a/libiscsi/libiscsi.c
+++ b/libiscsi/libiscsi.c
@@ -258,7 +258,7 @@ int libiscsi_discover_firmware(struct libiscsi_context *context,
struct libiscsi_node *new_node = new_nodes;
/* in one loop, add nodes to idbm and create libiscsi_node entries */
list_for_each_entry(rec, &rec_list, list) {
- CHECK(idbm_add_node(rec, NULL, 1 /* overwrite */));
+ CHECK(idbm_add_node(rec, &drec, 1 /* overwrite */));
strlcpy(new_node->name, rec->name, LIBISCSI_VALUE_MAXLEN);
new_node->tpgt = rec->tpgt;
diff --git a/usr/idbm.c b/usr/idbm.c
index e9025bf..9cc9c40 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2536,7 +2536,7 @@ int idbm_add_node(node_rec_t *newrec, discovery_rec_t *drec, int overwrite)
if (rc)
goto unlock;
- if (drec->type == DISCOVERY_TYPE_FW) {
+ if (drec && drec->type == DISCOVERY_TYPE_FW) {
log_debug(8, "setting firmware node 'startup' to 'onboot'");
newrec->startup = ISCSI_STARTUP_ONBOOT;
newrec->conn[0].startup = ISCSI_STARTUP_ONBOOT;
--
2.36.1

View File

@ -9,7 +9,7 @@
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.%{open_iscsi_version}.%{open_iscsi_build}
Release: 10.git%{shortcommit0}%{?dist}
Release: 11.git%{shortcommit0}%{?dist}
License: GPLv2+
URL: https://github.com/open-iscsi/open-iscsi
Source0: https://github.com/open-iscsi/open-iscsi/archive/%{commit0}.tar.gz#/open-iscsi-%{shortcommit0}.tar.gz
@ -42,6 +42,7 @@ Patch0023: 0023-stop-using-Werror-for-now.patch
Patch0024: 0024-minor-service-file-updates.patch
Patch0025: 0001-Remove-dependences-from-iscsi-init.service.patch
Patch0026: 0026-try-not-to-require-network-online.patch
Patch0027: 0001-fix-libiscsi-firmware-discovery-issue-with-NULL-drec.patch
BuildRequires: flex bison doxygen kmod-devel systemd-units
BuildRequires: autoconf automake libtool libmount-devel openssl-devel
@ -286,6 +287,9 @@ systemctl --no-reload preset iscsi.service iscsi-starter.service &>/dev/null ||
%{python3_sitearch}/*
%changelog
* Thu Apr 13 2023 Chris Leech <cleech@redhat.com> - 6.2.1.4-11.git2a8f9d8
- fix libiscsi regression causing faults in udisksd during iscsi firmware discovery
* Mon Feb 6 2023 Zbigniew Jedrzejewski-Szmek <zbyszek@in.waw.pl> - 6.2.1.4-10.git2a8f9d8
- Move fedora-release version requirement to the fedora-release-common subpackage