summarylogtreecommitdiffstats
path: root/xen_4.14.0_fixes.patch
blob: 68836a9b74c5b4ab8bd6c3ab2f3e719549c29fcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff -Naur orig/tools/libxl/libxlu_pci.c patched/tools/libxl/libxlu_pci.c
--- orig/tools/libxl/libxlu_pci.c	2020-07-23 08:07:51.000000000 -0700
+++ patched/tools/libxl/libxlu_pci.c	2020-07-29 14:40:08.956666630 -0700
@@ -50,6 +50,7 @@
     unsigned state = STATE_DOMAIN;
     unsigned dom, bus, dev, func, vslot = 0;
     char *buf2, *tok, *ptr, *end, *optkey = NULL;
+	dom = bus = dev = func = 0;
 
     if ( NULL == (buf2 = ptr = strdup(str)) )
         return ERROR_NOMEM;
diff -Naur orig/tools/libxl/libxl_utils.c patched/tools/libxl/libxl_utils.c
--- orig/tools/libxl/libxl_utils.c	2020-07-23 08:07:51.000000000 -0700
+++ patched/tools/libxl/libxl_utils.c	2020-07-29 14:40:08.956666630 -0700
@@ -1252,14 +1252,16 @@
                                struct sockaddr_un *un, const char *path,
                                const char *what)
 {
-    if (sizeof(un->sun_path) <= strlen(path)) {
+ 	 size_t len = strlen(path);
+
+ 	 if (sizeof(un->sun_path) <= len) {
         LOG(ERROR, "UNIX socket path '%s' is too long for %s", path, what);
-        LOG(DEBUG, "Path must be less than %zu bytes", sizeof(un->sun_path));
+		LOG(DEBUG, "Path of len %zu must be less than %zu bytes", len, sizeof(un->sun_path));
         return ERROR_INVAL;
     }
     memset(un, 0, sizeof(struct sockaddr_un));
     un->sun_family = AF_UNIX;
-    strncpy(un->sun_path, path, sizeof(un->sun_path));
+	memcpy(un->sun_path, path, len);
     return 0;
 }

diff -Naur orig/stubdom/vtpmmgr/vtpmmgr.h changed/stubdom/vtpmmgr/vtpmmgr.h
--- orig/stubdom/vtpmmgr/vtpmmgr.h	2020-05-14 05:19:32.000000000 -0700
+++ changed/stubdom/vtpmmgr/vtpmmgr.h	2020-05-20 12:04:28.506666463 -0700
@@ -50,7 +50,7 @@
 #define RSA_KEY_SIZE 0x0800
 #define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
 
-enum {
+extern enum {
     TPM1_HARDWARE = 1,
     TPM2_HARDWARE,
 } tpm_version;