Add patch fixing a memory corruption bug

Resolves: rhbz#1268666
This commit is contained in:
Christophe Fergeau 2015-10-05 11:45:44 +02:00
parent 850bf8e044
commit dd51a27a4b
3 changed files with 71 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From f97751faf0f5c66ec5ccbf5547ca7982d360cbf9 Mon Sep 17 00:00:00 2001
From: Victor Toso <victortoso@redhat.com>
Date: Tue, 15 Sep 2015 10:23:06 +0200
Subject: [vdagent-linux] Revert "uinput: fix small leak of screen_info"
This reverts commit 4835df0b642dfc963e7cbaabfe93da86482f0b93.
uinput only holds reference to screen_info and should not free it.
The leak should be fixed somewhere else.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1262635
---
src/vdagentd-uinput.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/vdagentd-uinput.c b/src/vdagentd-uinput.c
index 1ce9918..47e1b45 100644
--- a/src/vdagentd-uinput.c
+++ b/src/vdagentd-uinput.c
@@ -76,10 +76,6 @@ void vdagentd_uinput_destroy(struct vdagentd_uinput **uinputp)
if (uinput->fd != -1)
close(uinput->fd);
-
- if (uinput->screen_info != NULL)
- free(uinput->screen_info);
-
free(uinput);
*uinputp = NULL;
}

View File

@ -0,0 +1,30 @@
From 0159111b22b449cf6a0225723c25f3a0938bce3f Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau@redhat.com>
Date: Mon, 7 Sep 2015 16:38:10 +0200
Subject: [vdagent-linux] vdagent: Return '1' when virtio device cannot be
opened
The vdagent process currently exits with an error code set to 0 whenn
the virtio device cannot be opened (for example because it's missing).
This is not consistent with the other failures to startup which set the
exit code to 1. This commit ensures 1 is returned in this situation too.
Resolves: rhbz#1256704
---
src/vdagent.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/vdagent.c b/src/vdagent.c
index 348dfbd..d3ca0c3 100644
--- a/src/vdagent.c
+++ b/src/vdagent.c
@@ -291,7 +291,8 @@ int main(int argc, char *argv[])
LOG_USER);
if (file_test(portdev) != 0) {
- return 0;
+ syslog(LOG_ERR, "Cannot access vdagent virtio channel %s", portdev);
+ return 1;
}
if (do_daemonize)

View File

@ -1,12 +1,14 @@
Name: spice-vdagent
Version: 0.16.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Agent for Spice guests
Group: Applications/System
License: GPLv3+
URL: http://spice-space.org/
Source0: http://spice-space.org/download/releases/%{name}-%{version}.tar.bz2
# Fixes from upstream git
Patch1: 0001-Revert-uinput-fix-small-leak-of-screen_info.patch
Patch2: 0002-vdagent-Return-1-when-virtio-device-cannot-be-opened.patch
BuildRequires: systemd-devel glib2-devel spice-protocol >= 0.12.6
BuildRequires: libpciaccess-devel libXrandr-devel libXinerama-devel
BuildRequires: libXfixes-devel systemd-units desktop-file-utils libtool
@ -30,6 +32,8 @@ Features:
%prep
%setup -q
%patch1 -p1
%patch2 -p1
#autoreconf -fi
@ -69,6 +73,12 @@ make install DESTDIR=$RPM_BUILD_ROOT V=2
%changelog
* Mon Oct 05 2015 Christophe Fergeau <cfergeau@redhat.com> 0.16.0-2
- Add upstream patch fixing a memory corruption bug (double free)
Resolves: rhbz#1268666
Exit with a non-0 exit code when the virtio device cannot be opened by the
agent
* Tue Jun 30 2015 Christophe Fergeau <cfergeau@redhat.com> 0.16.0-1
- Update to 0.16.0 release