- libiscsi: use fwparam_ibft_sysfs() instead of fw_get_entry(), as the

latter causes stack corruption (workaround #490515)
This commit is contained in:
Hans de Goede 2009-03-20 14:49:24 +00:00
parent 599c1c817e
commit cd44d1200d
2 changed files with 26 additions and 14 deletions

View File

@ -3,7 +3,7 @@
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.2.0.870
Release: 6%{?dist}
Release: 7%{?dist}
Source0: http://www.open-iscsi.org/bits/open-iscsi-2.0-870.1.tar.gz
Source1: iscsid.init
Source2: iscsidevs.init
@ -19,6 +19,7 @@ Patch7: open-iscsi-2.0-870.1-add-libiscsi.patch
Patch8: open-iscsi-2.0-870.1-no-exit.patch
Patch9: open-iscsi-2.0-870.1-ibft-newer-kernel.patch
Patch10: open-iscsi-2.0-870.1-485217.patch
Patch11: open-iscsi-2.0-870.1-490515-workaround.patch
Group: System Environment/Daemons
License: GPLv2+
@ -57,6 +58,7 @@ developing applications that use %{name}.
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
@ -160,6 +162,10 @@ fi
%{_includedir}/libiscsi.h
%changelog
* Fri Mar 20 2009 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-7
- libiscsi: use fwparam_ibft_sysfs() instead of fw_get_entry(), as
the latter causes stack corruption (workaround #490515)
* Sat Mar 14 2009 Terje Rosten <terje.rosten@ntnu.no> - 6.2.0.870-6
- Add glibc-static to buildreq to build in F11

View File

@ -1,6 +1,18 @@
--- open-iscsi-2.0-870.1/libiscsi/libiscsi.c 2009-03-20 15:21:24.000000000 +0100
+++ new/libiscsi/libiscsi.c 2009-03-20 15:21:11.000000000 +0100
@@ -196,10 +196,10 @@
diff -up open-iscsi-2.0-870.1/include/fw_context.h.workaround open-iscsi-2.0-870.1/include/fw_context.h
--- open-iscsi-2.0-870.1/include/fw_context.h.workaround 2009-03-20 15:47:16.000000000 +0100
+++ open-iscsi-2.0-870.1/include/fw_context.h 2009-03-20 15:48:03.000000000 +0100
@@ -51,5 +51,7 @@ struct boot_context {
extern int fw_get_entry(struct boot_context *context, const char *filepath);
extern void fw_print_entry(struct boot_context *context);
+extern int fwparam_ibft_sysfs(struct boot_context *context,
+ const char *filepath);
#endif /* FWPARAM_CONTEXT_H_ */
diff -up open-iscsi-2.0-870.1/libiscsi/libiscsi.c.workaround open-iscsi-2.0-870.1/libiscsi/libiscsi.c
--- open-iscsi-2.0-870.1/libiscsi/libiscsi.c.workaround 2009-03-20 15:45:28.000000000 +0100
+++ open-iscsi-2.0-870.1/libiscsi/libiscsi.c 2009-03-20 15:47:03.000000000 +0100
@@ -196,10 +196,10 @@ int libiscsi_discover_firmware(struct li
*found_nodes = NULL;
memset(&fw_entry, 0, sizeof fw_entry);
@ -13,27 +25,21 @@
}
memset(&rec, 0, sizeof rec);
@@ -535,8 +535,10 @@
@@ -535,7 +535,7 @@ int libiscsi_get_firmware_network_config
memset(config, 0, sizeof *config);
memset(&fw_entry, 0, sizeof fw_entry);
- if (fw_get_entry(&fw_entry, NULL))
+ if (fwparam_ibft_sysfs(&fw_entry, NULL)) {
+ strcpy(context->error_str, "Could not read fw values.");
+ if (fwparam_ibft_sysfs(&fw_entry, NULL))
return ENODEV;
+ }
config->dhcp = strlen(fw_entry.dhcp) ? 1 : 0;
strncpy(config->iface_name, fw_entry.iface, sizeof fw_entry.iface);
@@ -557,8 +559,10 @@
@@ -557,7 +557,7 @@ int libiscsi_get_firmware_initiator_name
memset(initiatorname, 0, LIBISCSI_VALUE_MAXLEN);
memset(&fw_entry, 0, sizeof fw_entry);
- if (fw_get_entry(&fw_entry, NULL))
+ if (fwparam_ibft_sysfs(&fw_entry, NULL)) {
+ strcpy(context->error_str, "Could not read fw values.");
+ if (fwparam_ibft_sysfs(&fw_entry, NULL))
return ENODEV;
+ }
strncpy(initiatorname, fw_entry.initiatorname,
sizeof fw_entry.initiatorname);