[PATCH] apparmor: Fix use of uninitialized random_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without this, virt-aa-helper would segfault in -c or -r commands.
---
 src/security/virt-aa-helper.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 4561bb9..b484a20 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -42,6 +42,7 @@
 #include "pci.h"
 #include "virfile.h"
 #include "configmake.h"
+#include "virrandom.h"
 
 #define VIR_FROM_THIS VIR_FROM_SECURITY
 
@@ -1182,6 +1183,9 @@ main(int argc, char **argv)
 
     memset(ctl, 0, sizeof(vahControl));
 
+    if (virRandomInitialize(time(NULL) ^ getpid()) < 0)
+        vah_error(ctl, 1, _("could not initialize random generator"));
+
     if (vahParseArgv(ctl, argc, argv) != 0)
         vah_error(ctl, 1, _("could not parse arguments"));
 
-- 
1.7.8.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]