File: 9pfs-xattr-fix-memory-leak-in-v9fs_list_xattr-CVE-2017-8086.patch

package info (click to toggle)
qemu 1%3A2.8%2Bdfsg-6%2Bdeb9u9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 80,664 kB
  • sloc: ansic: 1,023,075; sh: 16,809; python: 15,697; cpp: 12,293; asm: 11,295; perl: 4,421; makefile: 2,076; objc: 1,224; xml: 708
file content (29 lines) | stat: -rw-r--r-- 788 bytes parent folder | download
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
From: Li Qiang <liq3ea@gmail.com>
Date: Fri, 7 Apr 2017 03:48:52 -0700
Subject: 9pfs: xattr: fix memory leak in v9fs_list_xattr (CVE-2017-8086)
Commit-Id: 4ffcdef4277a91af15a3c09f7d16af072c29f3f2
Bug-Debian: http://bugs.debian.org/861348

Free 'orig_value' in error path.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/9pfs/9p-xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/9pfs/9p-xattr.c b/hw/9pfs/9p-xattr.c
index eec160b3c2..d05c1a1c1d 100644
--- a/hw/9pfs/9p-xattr.c
+++ b/hw/9pfs/9p-xattr.c
@@ -108,6 +108,7 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
     g_free(name);
     close_preserve_errno(dirfd);
     if (xattr_len < 0) {
+        g_free(orig_value);
         return -1;
     }
 
-- 
2.11.0