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
=== modified file 'debian/changelog'
--- debian/changelog 2012-03-17 12:29:21 +0000
+++ debian/changelog 2012-10-05 20:36:26 +0000
@@ -1,3 +1,11 @@
1valgrind (1:3.7.0-0ubuntu4) quantal; urgency=low
2
3 * fix-buffer-overflows.patch: fix overflows in vgdb
4 * 05_fix-callgrind_control.patch: fix valgrind process name (LP: #1036283)
5 * fix-VEX-PCMPxSTRx.patch: fix strstr handling (LP: #1027977)
6
7 -- Julian Taylor <jtaylor@ubuntu.com> Fri, 05 Oct 2012 20:16:28 +0200
8
1valgrind (1:3.7.0-0ubuntu3) precise; urgency=low9valgrind (1:3.7.0-0ubuntu3) precise; urgency=low
210
3 * Add uinput ioctl wrappers to fix false positive errors. (LP: #958095)11 * Add uinput ioctl wrappers to fix false positive errors. (LP: #958095)
412
=== added file 'debian/patches/05_fix-callgrind_control.patch'
--- debian/patches/05_fix-callgrind_control.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/05_fix-callgrind_control.patch 2012-10-05 20:36:26 +0000
@@ -0,0 +1,18 @@
1Description: Fix callgrind_control that should look for valgrind.bin and not valgrind
2Origin: vendor
3Bug-Debian: http://bugs.debian.org/659215
4Author: Pierre Habouzit <madcoder@debian.org>
5Reviewed-by: Alessandro Ghedini <ghedo@debian.org>
6Last-Update: 2012-05-10
7
8--- a/callgrind/callgrind_control.in
9+++ b/callgrind/callgrind_control.in
10@@ -29,7 +29,7 @@
11 @pids = ();
12 open LIST, "vgdb -l|";
13 while(<LIST>) {
14- if (/^use --pid=(\d+) for \S*?valgrind\s+(.*?)\s*$/) {
15+ if (/^use --pid=(\d+) for \S*?valgrind\.bin\s+(.*?)\s*$/) {
16 $pid = $1;
17 $cmd = $2;
18 if (!($cmd =~ /--tool=callgrind/)) { next; }
019
=== added file 'debian/patches/fix-VEX-PCMPxSTRx.patch'
--- debian/patches/fix-VEX-PCMPxSTRx.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-VEX-PCMPxSTRx.patch 2012-10-05 20:36:26 +0000
@@ -0,0 +1,33 @@
1Description: upstream patch, modified to fit version 3.7.0
2 Emulation of PCMPxSTRx mode 0x0C was wrong
3 for searching an empty needle in an empty haystack.
4Applied-Upstream: 3.8.0
5Origin: r2447
6Author: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
7Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/valgrind/+bug/1027977
8Bug: https://bugs.kde.org/show_bug.cgi?id=303963
9
10diff --git a/VEX/priv/guest_generic_x87.c b/VEX/priv/guest_generic_x87.c
11index a10f869..ae627f6 100644
12--- a/VEX/priv/guest_generic_x87.c
13+++ b/VEX/priv/guest_generic_x87.c
14@@ -815,9 +815,6 @@ Bool compute_PCMPxSTRx ( /*OUT*/V128* resV,
15 UInt validL = ~(zmaskL | -zmaskL); // not(left(zmaskL))
16 UInt validR = ~(zmaskR | -zmaskR); // not(left(zmaskR))
17 for (hi = 0; hi < 16; hi++) {
18- if ((validL & (1 << hi)) == 0)
19- // run off the end of the haystack
20- break;
21 UInt m = 1;
22 for (ni = 0; ni < 16; ni++) {
23 if ((validR & (1 << ni)) == 0) break;
24@@ -826,6 +826,9 @@ Bool compute_PCMPxSTRx ( /*OUT*/V128* resV,
25 if (argL[i] != argR[ni]) { m = 0; break; }
26 }
27 boolRes |= (m << hi);
28+ if ((validL & (1 << hi)) == 0)
29+ // run off the end of the haystack
30+ break;
31 }
32
33 // boolRes is "pre-invalidated"
034
=== added file 'debian/patches/fix-buffer-overflows.patch'
--- debian/patches/fix-buffer-overflows.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-buffer-overflows.patch 2012-10-05 20:36:26 +0000
@@ -0,0 +1,59 @@
1Description: fix a couple of overflows
2Origin: r12319, r12493
3Applied-Upstream: 3.8.0
4
5--- a/coregrind/vgdb.c
6+++ b/coregrind/vgdb.c
7@@ -1364,7 +1364,7 @@
8 static
9 Bool read_from_gdb_write_to_pid(int to_pid)
10 {
11- char buf[PBUFSIZ];
12+ char buf[PBUFSIZ+1]; // +1 for trailing \0
13 int nrread;
14
15 nrread = read_buf(from_gdb, buf, "from gdb on stdin");
16@@ -1388,7 +1388,7 @@
17 static
18 Bool read_from_pid_write_to_gdb(int from_pid)
19 {
20- char buf[PBUFSIZ];
21+ char buf[PBUFSIZ+1]; // +1 for trailing \0
22 int nrread;
23
24 nrread = read_buf(from_pid, buf, "from pid");
25@@ -1493,14 +1493,14 @@
26 static int
27 readchar (int fd)
28 {
29- static unsigned char buf[PBUFSIZ];
30+ static unsigned char buf[PBUFSIZ+1]; // +1 for trailing \0
31 static int bufcnt = 0;
32 static unsigned char *bufp;
33
34 if (bufcnt-- > 0)
35 return *bufp++;
36
37- bufcnt = read (fd, buf, sizeof (buf));
38+ bufcnt = read_buf (fd, buf, "static buf readchar");
39
40 if (bufcnt <= 0) {
41 if (bufcnt == 0) {
42@@ -1874,7 +1874,7 @@
43 unsigned char hex[3];
44 unsigned char cksum;
45 unsigned char *hexcommand;
46- unsigned char buf[PBUFSIZ];
47+ unsigned char buf[PBUFSIZ+1]; // +1 for trailing \0
48 int buflen;
49 int nc;
50
51@@ -2151,7 +2151,7 @@
52 errno = 0; /* avoid complain if vgdb_dir is empty */
53 while ((f = readdir (vgdb_dir))) {
54 struct stat st;
55- char pathname[strlen(vgdb_dir_name) + strlen(f->d_name)];
56+ char pathname[strlen(vgdb_dir_name) + strlen(f->d_name) + 1];
57 char *wrongpid;
58 int newpid;
59
060
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-03-17 12:29:21 +0000
+++ debian/patches/series 2012-10-05 20:36:26 +0000
@@ -5,3 +5,6 @@
50009-glibc-215.patch50009-glibc-215.patch
60010-automake-1.11.2.patch60010-automake-1.11.2.patch
70011-uinput-ioctls.patch70011-uinput-ioctls.patch
8fix-buffer-overflows.patch
905_fix-callgrind_control.patch
10fix-VEX-PCMPxSTRx.patch

Subscribers

People subscribed via source and target branches

to all changes: