521c6d4a-x86-don-t-allow-Dom0-access-to-the-MSI-address-range.patch 521c6d6c-x86-don-t-allow-Dom0-access-to-the-HT-address-range.patch 521c6e23-x86-Intel-add-support-for-Haswell-CPU-models.patch 521db25f-Fix-inactive-timer-list-corruption-on-second-S3-resume.patch 521e1156-x86-AVX-instruction-emulation-fixes.patch 521ef8d9-AMD-IOMMU-add-missing-checks.patch 52205a7d-hvmloader-smbios-Correctly-count-the-number-of-tables-written.patch 52205a90-public-hvm_xs_strings.h-Fix-ABI-regression-for-OEM-SMBios-strings.patch 52205e27-x86-xsave-initialization-improvements.patch 5226020f-xend-handle-extended-PCI-configuration-space-when-saving-state.patch 52260214-xend-fix-file-descriptor-leak-in-pci-utilities.patch 52285317-hvmloader-fix-SeaBIOS-interface.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=271
49 lines
1.7 KiB
Diff
49 lines
1.7 KiB
Diff
# Commit 749019afca4fd002d36856bad002cc11f7d0ddda
|
|
# Date 2013-09-03 16:36:52 +0100
|
|
# Author Xi Xiong <xixiong@amazon.com>
|
|
# Committer Ian Campbell <ian.campbell@citrix.com>
|
|
xend: fix file descriptor leak in pci utilities
|
|
|
|
A file descriptor leak was detected after creating multiple domUs with
|
|
pass-through PCI devices. This patch fixes the issue.
|
|
|
|
Signed-off-by: Xi Xiong <xixiong@amazon.com>
|
|
Reviewed-by: Matt Wilson <msw@amazon.com>
|
|
[msw: adjusted commit message]
|
|
Signed-off-by: Matt Wilson <msw@amazon.com>
|
|
|
|
--- 2013-08-30.orig/tools/python/xen/util/pci.py 2013-09-09 11:24:09.000000000 +0200
|
|
+++ 2013-08-30/tools/python/xen/util/pci.py 2013-09-09 11:24:14.000000000 +0200
|
|
@@ -969,18 +969,22 @@ class PciDevice:
|
|
ttl = 480; # 3840 bytes, minimum 8 bytes per capability
|
|
pos = 0x100
|
|
|
|
+ fd = None
|
|
try:
|
|
fd = os.open(path, os.O_RDONLY)
|
|
os.lseek(fd, pos, 0)
|
|
h = os.read(fd, 4)
|
|
if len(h) == 0: # MMCONF is not enabled?
|
|
+ os.close(fd)
|
|
return 0
|
|
header = struct.unpack('I', h)[0]
|
|
if header == 0 or header == -1:
|
|
+ os.close(fd)
|
|
return 0
|
|
|
|
while ttl > 0:
|
|
if (header & 0x0000ffff) == cap:
|
|
+ os.close(fd)
|
|
return pos
|
|
pos = (header >> 20) & 0xffc
|
|
if pos < 0x100:
|
|
@@ -990,6 +994,8 @@ class PciDevice:
|
|
ttl = ttl - 1
|
|
os.close(fd)
|
|
except OSError, (errno, strerr):
|
|
+ if fd is not None:
|
|
+ os.close(fd)
|
|
raise PciDeviceParseError(('Error when accessing sysfs: %s (%d)' %
|
|
(strerr, errno)))
|
|
return 0
|