Merge lp:~jtaylor/ubuntu/quantal/valgrind/various-fixes into lp:ubuntu/quantal/valgrind

Proposed by Julian Taylor
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~jtaylor/ubuntu/quantal/valgrind/various-fixes
Merge into: lp:ubuntu/quantal/valgrind
Diff against target: 151 lines (+121/-0)
5 files modified
debian/changelog (+8/-0)
debian/patches/05_fix-callgrind_control.patch (+18/-0)
debian/patches/fix-VEX-PCMPxSTRx.patch (+33/-0)
debian/patches/fix-buffer-overflows.patch (+59/-0)
debian/patches/series (+3/-0)
To merge this branch: bzr merge lp:~jtaylor/ubuntu/quantal/valgrind/various-fixes
Reviewer Review Type Date Requested Status
Micah Gersten (community) Approve
Ubuntu branches Pending
Review via email: mp+128314@code.launchpad.net

Description of the change

fixes a couple issues, the buffer overflow is essential as vgdb will break when rebuilt otherwise.
all are relevant for an precise SRU see the associated bugs

To post a comment you must log in.
Revision history for this message
Micah Gersten (micahg) wrote :

Looks fine, as it's bug fix, sponsoring

review: Approve
Revision history for this message
Micah Gersten (micahg) wrote :

uploaded, waiting in queue

Revision history for this message
Martin Pitt (pitti) wrote :

This is in quantal, apparently Micah didn't push the branch. Closing manually. Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-03-17 12:29:21 +0000
3+++ debian/changelog 2012-10-05 20:36:26 +0000
4@@ -1,3 +1,11 @@
5+valgrind (1:3.7.0-0ubuntu4) quantal; urgency=low
6+
7+ * fix-buffer-overflows.patch: fix overflows in vgdb
8+ * 05_fix-callgrind_control.patch: fix valgrind process name (LP: #1036283)
9+ * fix-VEX-PCMPxSTRx.patch: fix strstr handling (LP: #1027977)
10+
11+ -- Julian Taylor <jtaylor@ubuntu.com> Fri, 05 Oct 2012 20:16:28 +0200
12+
13 valgrind (1:3.7.0-0ubuntu3) precise; urgency=low
14
15 * Add uinput ioctl wrappers to fix false positive errors. (LP: #958095)
16
17=== added file 'debian/patches/05_fix-callgrind_control.patch'
18--- debian/patches/05_fix-callgrind_control.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/05_fix-callgrind_control.patch 2012-10-05 20:36:26 +0000
20@@ -0,0 +1,18 @@
21+Description: Fix callgrind_control that should look for valgrind.bin and not valgrind
22+Origin: vendor
23+Bug-Debian: http://bugs.debian.org/659215
24+Author: Pierre Habouzit <madcoder@debian.org>
25+Reviewed-by: Alessandro Ghedini <ghedo@debian.org>
26+Last-Update: 2012-05-10
27+
28+--- a/callgrind/callgrind_control.in
29++++ b/callgrind/callgrind_control.in
30+@@ -29,7 +29,7 @@
31+ @pids = ();
32+ open LIST, "vgdb -l|";
33+ while(<LIST>) {
34+- if (/^use --pid=(\d+) for \S*?valgrind\s+(.*?)\s*$/) {
35++ if (/^use --pid=(\d+) for \S*?valgrind\.bin\s+(.*?)\s*$/) {
36+ $pid = $1;
37+ $cmd = $2;
38+ if (!($cmd =~ /--tool=callgrind/)) { next; }
39
40=== added file 'debian/patches/fix-VEX-PCMPxSTRx.patch'
41--- debian/patches/fix-VEX-PCMPxSTRx.patch 1970-01-01 00:00:00 +0000
42+++ debian/patches/fix-VEX-PCMPxSTRx.patch 2012-10-05 20:36:26 +0000
43@@ -0,0 +1,33 @@
44+Description: upstream patch, modified to fit version 3.7.0
45+ Emulation of PCMPxSTRx mode 0x0C was wrong
46+ for searching an empty needle in an empty haystack.
47+Applied-Upstream: 3.8.0
48+Origin: r2447
49+Author: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
50+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/1027977
51+Bug: https://bugs.kde.org/show_bug.cgi?id=303963
52+
53+diff --git a/VEX/priv/guest_generic_x87.c b/VEX/priv/guest_generic_x87.c
54+index a10f869..ae627f6 100644
55+--- a/VEX/priv/guest_generic_x87.c
56++++ b/VEX/priv/guest_generic_x87.c
57+@@ -815,9 +815,6 @@ Bool compute_PCMPxSTRx ( /*OUT*/V128* resV,
58+ UInt validL = ~(zmaskL | -zmaskL); // not(left(zmaskL))
59+ UInt validR = ~(zmaskR | -zmaskR); // not(left(zmaskR))
60+ for (hi = 0; hi < 16; hi++) {
61+- if ((validL & (1 << hi)) == 0)
62+- // run off the end of the haystack
63+- break;
64+ UInt m = 1;
65+ for (ni = 0; ni < 16; ni++) {
66+ if ((validR & (1 << ni)) == 0) break;
67+@@ -826,6 +826,9 @@ Bool compute_PCMPxSTRx ( /*OUT*/V128* resV,
68+ if (argL[i] != argR[ni]) { m = 0; break; }
69+ }
70+ boolRes |= (m << hi);
71++ if ((validL & (1 << hi)) == 0)
72++ // run off the end of the haystack
73++ break;
74+ }
75+
76+ // boolRes is "pre-invalidated"
77
78=== added file 'debian/patches/fix-buffer-overflows.patch'
79--- debian/patches/fix-buffer-overflows.patch 1970-01-01 00:00:00 +0000
80+++ debian/patches/fix-buffer-overflows.patch 2012-10-05 20:36:26 +0000
81@@ -0,0 +1,59 @@
82+Description: fix a couple of overflows
83+Origin: r12319, r12493
84+Applied-Upstream: 3.8.0
85+
86+--- a/coregrind/vgdb.c
87++++ b/coregrind/vgdb.c
88+@@ -1364,7 +1364,7 @@
89+ static
90+ Bool read_from_gdb_write_to_pid(int to_pid)
91+ {
92+- char buf[PBUFSIZ];
93++ char buf[PBUFSIZ+1]; // +1 for trailing \0
94+ int nrread;
95+
96+ nrread = read_buf(from_gdb, buf, "from gdb on stdin");
97+@@ -1388,7 +1388,7 @@
98+ static
99+ Bool read_from_pid_write_to_gdb(int from_pid)
100+ {
101+- char buf[PBUFSIZ];
102++ char buf[PBUFSIZ+1]; // +1 for trailing \0
103+ int nrread;
104+
105+ nrread = read_buf(from_pid, buf, "from pid");
106+@@ -1493,14 +1493,14 @@
107+ static int
108+ readchar (int fd)
109+ {
110+- static unsigned char buf[PBUFSIZ];
111++ static unsigned char buf[PBUFSIZ+1]; // +1 for trailing \0
112+ static int bufcnt = 0;
113+ static unsigned char *bufp;
114+
115+ if (bufcnt-- > 0)
116+ return *bufp++;
117+
118+- bufcnt = read (fd, buf, sizeof (buf));
119++ bufcnt = read_buf (fd, buf, "static buf readchar");
120+
121+ if (bufcnt <= 0) {
122+ if (bufcnt == 0) {
123+@@ -1874,7 +1874,7 @@
124+ unsigned char hex[3];
125+ unsigned char cksum;
126+ unsigned char *hexcommand;
127+- unsigned char buf[PBUFSIZ];
128++ unsigned char buf[PBUFSIZ+1]; // +1 for trailing \0
129+ int buflen;
130+ int nc;
131+
132+@@ -2151,7 +2151,7 @@
133+ errno = 0; /* avoid complain if vgdb_dir is empty */
134+ while ((f = readdir (vgdb_dir))) {
135+ struct stat st;
136+- char pathname[strlen(vgdb_dir_name) + strlen(f->d_name)];
137++ char pathname[strlen(vgdb_dir_name) + strlen(f->d_name) + 1];
138+ char *wrongpid;
139+ int newpid;
140+
141
142=== modified file 'debian/patches/series'
143--- debian/patches/series 2012-03-17 12:29:21 +0000
144+++ debian/patches/series 2012-10-05 20:36:26 +0000
145@@ -5,3 +5,6 @@
146 0009-glibc-215.patch
147 0010-automake-1.11.2.patch
148 0011-uinput-ioctls.patch
149+fix-buffer-overflows.patch
150+05_fix-callgrind_control.patch
151+fix-VEX-PCMPxSTRx.patch

Subscribers

People subscribed via source and target branches

to all changes: