diff --git a/SOURCES/fcoe-utils-v1.0.31-9-fcoeadm-target-segfault-with-other-FC-storage-presen.patch b/SOURCES/fcoe-utils-v1.0.31-9-fcoeadm-target-segfault-with-other-FC-storage-presen.patch new file mode 100644 index 0000000..2ea22a9 --- /dev/null +++ b/SOURCES/fcoe-utils-v1.0.31-9-fcoeadm-target-segfault-with-other-FC-storage-presen.patch @@ -0,0 +1,56 @@ +From 9b295b18014a8fdc05acf6ceb9343c5c1e2ae716 Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Thu, 20 Oct 2016 13:56:43 -0700 +Subject: fcoeadm: --target segfault with other FC storage present + +fcoeadm is segfaulting when trying to parse sysfs paths to rports for +traditional FC or non fcoe-utils/libfc FCoE. + +I also changed search_rports to just ignore these instead of returning +an error, so that the target information for all fcoe-utils managed +storage can be displayed instead of stopping at the first exception. + +Signed-off-by: Chris Leech +Signed-off-by: Johannes Thumshirn +--- + fcoeadm_display.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/fcoeadm_display.c b/fcoeadm_display.c +index 096fe50..120c608 100644 +--- a/fcoeadm_display.c ++++ b/fcoeadm_display.c +@@ -660,17 +660,19 @@ static char *get_ifname_from_rport(char *rport) + + err = asprintf(&path, "%s/%s", "/sys/class/fc_remote_ports", rport); + if (err == -1) +- return false; ++ return NULL; + + ret = readlink(path, link, sizeof(link)); + free(path); + if (ret == -1) +- return false; ++ return NULL; + + if (link[ret] != '\0') + link[ret] = '\0'; + + offs = strstr(link, "/net/"); ++ if (!offs) ++ return NULL; + + offs = offs + 5; + +@@ -778,7 +780,7 @@ static int search_rports(struct dirent *dp, void *arg) + } else { + ifname = get_ifname_from_rport(rport); + if (!ifname) +- return -ENOMEM; ++ return 0; + allocated = true; + } + +-- +2.9.3 + diff --git a/SPECS/fcoe-utils.spec b/SPECS/fcoe-utils.spec index e942ff4..ca57c81 100644 --- a/SPECS/fcoe-utils.spec +++ b/SPECS/fcoe-utils.spec @@ -5,7 +5,7 @@ Name: fcoe-utils Version: 1.0.31 -Release: 1.git%{checkout}%{?dist} +Release: 1.git%{checkout}%{?dist}.1 Summary: Fibre Channel over Ethernet utilities Group: Applications/System License: GPLv2 @@ -20,6 +20,7 @@ ExcludeArch: ppc s390 Patch1: fcoe-utils-v1.0.31-1-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch Patch2: fcoe-utils-v1.0.31-2-fcoeadm-Fix-possible-buffer-overflows.patch Patch3: fcoe-utils-v1.0.30-3-sanmac-isn-t-required.patch +Patch4: fcoe-utils-v1.0.31-9-fcoeadm-target-segfault-with-other-FC-storage-presen.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: libpciaccess-devel @@ -94,6 +95,9 @@ sed -i -e 's/SUPPORTED_DRIVERS="libfc fcoe bnx2fc"/SUPPORTED_DRIVERS="libfc fcoe %{_libexecdir}/fcoe/ %changelog +* Fri Feb 24 2017 Chris Leech - 1.0.31-1.git5dfd3e4.el7_3.1 +- 1426634 fix core dump when running fcoeadm -t with non-libfc FC/FCoE storage + * Fri Aug 19 2016 Chris Leech - 1.0.31-1.git5dfd3e4 - 1274530 rebase to upstream 1.0.31+ - no longer requires libhbaapi/libhbalinux