diff --git a/SOURCES/0001-Ignore-32-bit-domains.patch b/SOURCES/0001-Ignore-32-bit-domains.patch new file mode 100644 index 0000000..591907e --- /dev/null +++ b/SOURCES/0001-Ignore-32-bit-domains.patch @@ -0,0 +1,56 @@ +From 099489b7917da44de57f3214425ea9b4a8f36482 Mon Sep 17 00:00:00 2001 +From: Keith Busch +Date: Wed, 10 Aug 2016 17:05:23 -0600 +Subject: [PATCH] Ignore 32-bit domains + +A pci "domain" need not be limited to the 16-bits. The Linux kernel +currently supports 32-bit domains which cause startx to segfault. Updating +libpciaccess to support 32-bit domains breaks the library's ABI, and +domains requiring 32-bits are not necessary for startx anyway, so this +patch ignores them. + +Reported-by: Pawel Baldysiak +Signed-off-by: Keith Busch +Reviewed-by: Eric Anholt +--- + src/linux_sysfs.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c +index 6367b11..cd2713d 100644 +--- a/src/linux_sysfs.c ++++ b/src/linux_sysfs.c +@@ -119,18 +119,28 @@ pci_system_linux_sysfs_create( void ) + + + /** +- * Filter out the names "." and ".." from the scanned sysfs entries. ++ * Filter out the names "." and ".." from the scanned sysfs entries, and ++ * domains requiring 32-bits. + * + * \param d Directory entry being processed by \c scandir. + * + * \return +- * Zero if the entry name matches either "." or "..", non-zero otherwise. ++ * Zero if the entry name matches either "." or "..", or the domain requires ++ * 32 bits, non-zero otherwise. + * + * \sa scandir, populate_entries + */ + static int + scan_sys_pci_filter( const struct dirent * d ) + { ++ if (d->d_name[0] != '.') { ++ unsigned dom = 0; ++ ++ sscanf(d->d_name, "%x:", &dom); ++ if (dom > USHRT_MAX) ++ return 0; ++ } ++ + return !((strcmp( d->d_name, "." ) == 0) + || (strcmp( d->d_name, ".." ) == 0)); + } +-- +2.5.5 + diff --git a/SOURCES/0001-linux_sysfs-include-limits.h-for-PATH_MAX.patch b/SOURCES/0001-linux_sysfs-include-limits.h-for-PATH_MAX.patch new file mode 100644 index 0000000..cc99f1a --- /dev/null +++ b/SOURCES/0001-linux_sysfs-include-limits.h-for-PATH_MAX.patch @@ -0,0 +1,26 @@ +From 8ea3af620a2d4ad5648917b4a0ef2b23ff566774 Mon Sep 17 00:00:00 2001 +From: Felix Janda +Date: Thu, 4 Dec 2014 23:52:22 +0100 +Subject: [PATCH] linux_sysfs: include for PATH_MAX + +Signed-off-by: Felix Janda +Tested-by: Bernd Kuhls +--- + src/linux_sysfs.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c +index 3f95e53..5a59bd8 100644 +--- a/src/linux_sysfs.c ++++ b/src/linux_sysfs.c +@@ -49,6 +49,7 @@ + #include + #include + #include ++#include + + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) + #include +-- +2.5.5 + diff --git a/SPECS/libpciaccess.spec b/SPECS/libpciaccess.spec index 203c49d..86bb8a3 100644 --- a/SPECS/libpciaccess.spec +++ b/SPECS/libpciaccess.spec @@ -3,7 +3,7 @@ Name: libpciaccess Version: 0.13.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: PCI access library Group: System Environment/Libraries @@ -18,6 +18,9 @@ Source1: make-libpciaccess-snapshot.sh Patch2: libpciaccess-rom-size.patch +Patch3: 0001-linux_sysfs-include-limits.h-for-PATH_MAX.patch +Patch4: 0001-Ignore-32-bit-domains.patch + BuildRequires: autoconf automake libtool pkgconfig xorg-x11-util-macros Requires: hwdata @@ -37,6 +40,8 @@ Development package for libpciaccess. %prep %setup -q -n %{name}-%{?gitdate:%{gitdate}}%{!?gitdate:%{version}} %patch2 -p1 -b .rom-size +%patch3 -p1 -b .limits +%patch4 -p1 -b .domain32 %build # autoreconf -v --install @@ -67,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/pkgconfig/pciaccess.pc %changelog +* Mon Nov 14 2016 Dave Airlie - 0.13.4-3 +- add support to ignore 32-bit domains (#1380184) + * Fri May 22 2015 Dave Airlie 0.13.4-2 - rebuild due to ppc64le relro issue