]> xenbits.xensource.com Git - libvirt.git/commitdiff
Buffer size too small when reading sysinfo
authorBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Wed, 17 Dec 2014 15:47:11 +0000 (16:47 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 18 Dec 2014 00:00:58 +0000 (17:00 -0700)
On a system with 160 CPUs the /proc/cpuinfo size grows beyond
the currently set limit of 10KB causing an internal error.

This patch increases the buffer size to 1MB.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
src/util/virsysinfo.c

index d644dbc8afd8e89c095ff12f99dcc66bbf8d63ce..4edce66a6bae13fda7a7607dce74a7dab108bea7 100644 (file)
@@ -50,7 +50,7 @@ static const char *sysinfoCpuinfo = "/proc/cpuinfo";
 #define SYSINFO_SMBIOS_DECODER sysinfoDmidecode
 #define SYSINFO sysinfoSysinfo
 #define CPUINFO sysinfoCpuinfo
-#define CPUINFO_FILE_LEN (10*1024)     /* 10KB limit for /proc/cpuinfo file */
+#define CPUINFO_FILE_LEN (1024*1024)   /* 1MB limit for /proc/cpuinfo file */
 
 /* only to be used test programs, therefore not in sysinfo.h */
 extern void virSysinfoSetup(const char *dmidecode, const char *sysinfo,