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

Bug#507515: marked as done ([PR libmudflap/24619] mudflap instrumentation of dlopen is incorrect)

Your message dated Wed, 12 Feb 2014 13:37:36 +0100
with message-id <52FB6B10.6030809@debian.org>
and subject line mudflap removed in GCC trunk
has caused the Debian Bug report #507515,
regarding [PR libmudflap/24619] mudflap instrumentation of dlopen is incorrect
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org

507515: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=507515
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-snapshot
Version: 20051023-1
Severity: normal
Tags: patch

Hash: RIPEMD160

If mudflap is used to instrument a program using dlopen, and the program
(assuming it is compiled with -rdynamic) loads itself by passing NULL for the
path to dlopen, the program will crash unconditionally; that is, regardless of
the options passed to mudflap, so long as instrumentation is enabled.

This is because (at least with GNU/Linux) it is valid to pass a NULL pointer as
the path argument to dlopen, and the instrumentation code unconditionally uses
strlen on that pointer, without checking first if it is NULL.

I have included the following patch, which may help fix the problem.  I have not
tested it, but it should work.  As always, it is "as is", with no warranty of
any kind.  The patch is against svn HEAD (r104588).

- --- mf-hooks2.c.orig	2005-10-30 20:35:44.000000000 +0000
+++ mf-hooks2.c	2005-10-30 20:37:38.000000000 +0000
@@ -1679,8 +1679,10 @@ WRAPPER2(void *, dlopen, const char *pat
   void *p;
   size_t n;
   TRACE ("%s\n", __PRETTY_FUNCTION__);
- -  n = strlen (path);
- -  MF_VALIDATE_EXTENT (path, CLAMPADD(n, 1), __MF_CHECK_READ, "dlopen path");
+  if (NULL != path) {
+    n = strlen (path);
+    MF_VALIDATE_EXTENT (path, CLAMPADD(n, 1), __MF_CHECK_READ, "dlopen path");
+  }
   p = dlopen (path, flags);
   if (NULL != p) {
 #ifdef MF_REGISTER_dlopen

- -- System Information:
Debian Release: testing/unstable
  APT prefers experimental
  APT policy: (500, 'experimental'), (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-1-k7
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)

Versions of packages gcc-snapshot depends on:
ii  binutils           2.16.1cvs20050902-1   The GNU assembler, linker and bina
ii  libart-2.0-2       2.3.17-1              Library of functions for 2D graphi
ii  libatk1.0-0        1.10.3-1              The ATK accessibility toolkit
ii  libc6              2.3.5-7               GNU C Library: Shared libraries an
ii  libc6-dev          2.3.5-7               GNU C Library: Development Librari
ii  libcairo2          1.0.2-1               The Cairo 2D vector graphics libra
ii  libfontconfig1     2.3.2-1.1             generic font configuration library
ii  libfreetype6       2.1.10-1              FreeType 2 font engine, shared lib
ii  libglib2.0-0       2.8.3-1               The GLib library of C routines
ii  libgmp3c2          4.1.4-11              Multiprecision arithmetic library
ii  libgtk2.0-0        2.8.3-1               The GTK+ graphical user interface 
ii  libpango1.0-0      1.10.1-1              Layout and rendering of internatio
ii  libpng12-0         1.2.8rel-5            PNG library - runtime
ii  libx11-6    X Window System protocol client li
ii  libxrender1        1:0.9.0+CVS20050919-2 X Rendering Extension client libra
ii  libxtst6    X Window System event recording an
ii  xlibs       X Window System client libraries m
ii  zlib1g             1:1.2.3-6             compression library - runtime

gcc-snapshot recommends no packages.

- -- no debconf information

Version: GnuPG v1.4.2 (GNU/Linux)


--- End Message ---
--- Begin Message ---
mudflap removed in GCC trunk, closing open issues.

--- End Message ---

Reply to: