[insight/f17] * Thu Nov 15 2012 Patrick Monnerat <pm at datasphere.ch> 7.4.50-4.20120403cvs - Path "objalloc" to fix

Patrick Monnerat monnerat at fedoraproject.org
Thu Nov 15 18:46:43 UTC 2012


commit 3e48ff74fcefd4588c42529fd7045dbc9fe72d5d
Author: Patrick Monnerat <pm at datasphere.ch>
Date:   Thu Nov 15 19:46:20 2012 +0100

    * Thu Nov 15 2012 Patrick Monnerat <pm at datasphere.ch> 7.4.50-4.20120403cvs
    - Path "objalloc" to fix libiberty security bug CVE-2012-3509.
      https://bugzilla.redhat.com/show_bug.cgi?id=877014
    - Enable Python to support STL extensions.
      https://bugzilla.redhat.com/show_bug.cgi?id=865554
    - Patch "structsiginfo" to replace occurrences of "struct siginfo" by
      "siginfo_t".

 insight-7.4.50-objalloc.patch      |   47 ++++++++++++
 insight-7.4.50-structsiginfo.patch |  136 ++++++++++++++++++++++++++++++++++++
 insight.spec                       |   47 +++++++++----
 3 files changed, 216 insertions(+), 14 deletions(-)
---
diff --git a/insight-7.4.50-objalloc.patch b/insight-7.4.50-objalloc.patch
new file mode 100644
index 0000000..0f4d413
--- /dev/null
+++ b/insight-7.4.50-objalloc.patch
@@ -0,0 +1,47 @@
+diff -Naur insight-7.4.50.orig/libiberty/ChangeLog insight-7.4.50.new/libiberty/ChangeLog
+--- insight-7.4.50.orig/libiberty/ChangeLog	2012-04-02 20:50:26.000000000 +0200
++++ insight-7.4.50.new/libiberty/ChangeLog	2012-11-15 18:21:07.340564549 +0100
+@@ -1,3 +1,9 @@
++2012-09-18  Florian Weimer  <fweimer at redhat.com>
++
++	PR other/54411
++	* objalloc.c (_objalloc_alloc): Add overflow check covering
++	alignment and CHUNK_HEADER_SIZE addition.
++
+ 2012-04-02  Tristan Gingold  <gingold at adacore.com>
+ 
+ 	* stack-limit.c: Includes ansidecl.h.
+diff -Naur insight-7.4.50.orig/libiberty/objalloc.c insight-7.4.50.new/libiberty/objalloc.c
+--- insight-7.4.50.orig/libiberty/objalloc.c	2005-07-22 05:26:05.000000000 +0200
++++ insight-7.4.50.new/libiberty/objalloc.c	2012-11-15 18:19:12.102878869 +0100
+@@ -1,5 +1,5 @@
+ /* objalloc.c -- routines to allocate memory for objects
+-   Copyright 1997 Free Software Foundation, Inc.
++   Copyright 1997-2012 Free Software Foundation, Inc.
+    Written by Ian Lance Taylor, Cygnus Solutions.
+ 
+ This program is free software; you can redistribute it and/or modify it
+@@ -112,8 +112,10 @@
+ /* Allocate space from an objalloc structure.  */
+ 
+ PTR
+-_objalloc_alloc (struct objalloc *o, unsigned long len)
++_objalloc_alloc (struct objalloc *o, unsigned long original_len)
+ {
++  unsigned long len = original_len;
++
+   /* We avoid confusion from zero sized objects by always allocating
+      at least 1 byte.  */
+   if (len == 0)
+@@ -121,6 +123,11 @@
+ 
+   len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1);
+ 
++  /* Check for overflow in the alignment operation above and the
++     malloc argument below. */
++  if (len + CHUNK_HEADER_SIZE < original_len)
++    return NULL;
++
+   if (len <= o->current_space)
+     {
+       o->current_ptr += len;
diff --git a/insight-7.4.50-structsiginfo.patch b/insight-7.4.50-structsiginfo.patch
new file mode 100644
index 0000000..2a91a60
--- /dev/null
+++ b/insight-7.4.50-structsiginfo.patch
@@ -0,0 +1,136 @@
+diff -Naur insight-7.4.50.orig/gdb/alpha-linux-tdep.c insight-7.4.50.new/gdb/alpha-linux-tdep.c
+--- insight-7.4.50.orig/gdb/alpha-linux-tdep.c	2012-02-02 21:19:09.000000000 +0100
++++ insight-7.4.50.new/gdb/alpha-linux-tdep.c	2012-07-20 12:26:13.763559351 +0200
+@@ -114,7 +114,7 @@
+   /* __NR_rt_sigreturn has a couple of structures on the stack.  This is:
+ 
+ 	struct rt_sigframe {
+-	  struct siginfo info;
++	  siginfo_t info;
+ 	  struct ucontext uc;
+         };
+ 
+diff -Naur insight-7.4.50.orig/gdb/arm-linux-tdep.c insight-7.4.50.new/gdb/arm-linux-tdep.c
+--- insight-7.4.50.orig/gdb/arm-linux-tdep.c	2012-03-27 17:46:33.000000000 +0200
++++ insight-7.4.50.new/gdb/arm-linux-tdep.c	2012-07-20 12:27:47.903036600 +0200
+@@ -301,7 +301,7 @@
+ 
+ /* There are three elements in an rt_sigframe before the ucontext:
+    pinfo, puc, and info.  The first two are pointers and the third
+-   is a struct siginfo, with size 128 bytes.  We could follow puc
++   is a siginfo_t, with size 128 bytes.  We could follow puc
+    to the ucontext, but it's simpler to skip the whole thing.  */
+ #define ARM_OLD_RT_SIGFRAME_SIGINFO 0x8
+ #define ARM_OLD_RT_SIGFRAME_UCONTEXT 0x88
+diff -Naur insight-7.4.50.orig/gdb/frv-linux-tdep.c insight-7.4.50.new/gdb/frv-linux-tdep.c
+--- insight-7.4.50.orig/gdb/frv-linux-tdep.c	2012-02-02 21:19:13.000000000 +0100
++++ insight-7.4.50.new/gdb/frv-linux-tdep.c	2012-07-20 12:26:02.021876204 +0200
+@@ -95,9 +95,9 @@
+       {
+ 	      void (*pretcode)(void);
+ 	      int sig;
+-	      struct siginfo *pinfo;
++	      siginfo_t *pinfo;
+ 	      void *puc;
+-	      struct siginfo info;
++	      siginfo_t info;
+ 	      struct ucontext uc;
+ 	      uint32_t retcode[2];
+       };
+diff -Naur insight-7.4.50.orig/gdb/hppa-linux-tdep.c insight-7.4.50.new/gdb/hppa-linux-tdep.c
+--- insight-7.4.50.orig/gdb/hppa-linux-tdep.c	2012-01-04 09:17:03.000000000 +0100
++++ insight-7.4.50.new/gdb/hppa-linux-tdep.c	2012-07-20 12:28:48.026534768 +0200
+@@ -181,10 +181,10 @@
+     }
+ 
+   /* sp + sfoffs[try] points to a struct rt_sigframe, which contains
+-     a struct siginfo and a struct ucontext.  struct ucontext contains
++     a siginfo_t and a struct ucontext.  struct ucontext contains
+      a struct sigcontext.  Return an offset to this sigcontext here.  Too 
+      bad we cannot include system specific headers :-(.
+-     sizeof(struct siginfo) == 128
++     sizeof(siginfo_t) == 128
+      offsetof(struct ucontext, uc_mcontext) == 24.  */
+   return sp + sfoffs[try] + 128 + 24;
+ }
+diff -Naur insight-7.4.50.orig/gdb/linux-nat.c insight-7.4.50.new/gdb/linux-nat.c
+--- insight-7.4.50.orig/gdb/linux-nat.c	2012-07-20 12:22:19.272916619 +0200
++++ insight-7.4.50.new/gdb/linux-nat.c	2012-07-20 12:28:59.428198153 +0200
+@@ -5199,7 +5199,7 @@
+ siginfo_t *
+ linux_nat_get_siginfo (ptid_t ptid)
+ {
+-  static struct siginfo siginfo;
++  static siginfo_t siginfo;
+   int pid;
+ 
+   pid = GET_LWP (ptid);
+diff -Naur insight-7.4.50.orig/gdb/linux-tdep.c insight-7.4.50.new/gdb/linux-tdep.c
+--- insight-7.4.50.orig/gdb/linux-tdep.c	2012-03-01 22:13:59.000000000 +0100
++++ insight-7.4.50.new/gdb/linux-tdep.c	2012-07-20 12:28:06.383111814 +0200
+@@ -158,7 +158,7 @@
+   append_composite_type_field (type, "si_fd", int_type);
+   append_composite_type_field (sifields_type, "_sigpoll", type);
+ 
+-  /* struct siginfo */
++  /* siginfo_t */
+   siginfo_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
+   TYPE_NAME (siginfo_type) = xstrdup ("siginfo");
+   append_composite_type_field (siginfo_type, "si_signo", int_type);
+diff -Naur insight-7.4.50.orig/gdb/mips-linux-tdep.c insight-7.4.50.new/gdb/mips-linux-tdep.c
+--- insight-7.4.50.orig/gdb/mips-linux-tdep.c	2012-03-02 01:06:12.000000000 +0100
++++ insight-7.4.50.new/gdb/mips-linux-tdep.c	2012-07-20 12:27:26.809809340 +0200
+@@ -895,7 +895,7 @@
+    struct rt_sigframe {
+      u32 rs_ass[4];            [argument save space for o32]
+      u32 rs_code[2]            [signal trampoline or fill]
+-     struct siginfo rs_info;
++     siginfo_t rs_info;
+      struct ucontext rs_uc;
+    };
+ 
+@@ -1023,7 +1023,7 @@
+   struct rt_sigframe_n32 {
+     u32 rs_ass[4];                  [ argument save space for o32 ]
+     u32 rs_code[2];                 [ signal trampoline or fill ]
+-    struct siginfo rs_info;
++    siginfo_t rs_info;
+     struct ucontextn32 rs_uc;
+   };
+ 
+@@ -1038,7 +1038,7 @@
+   struct rt_sigframe {
+     u32 rs_ass[4];                  [ argument save space for o32 ]
+     u32 rs_code[2];                 [ signal trampoline ]
+-    struct siginfo rs_info;
++    siginfo_t rs_info;
+     struct ucontext rs_uc;
+   };
+ 
+diff -Naur insight-7.4.50.orig/gdb/mn10300-linux-tdep.c insight-7.4.50.new/gdb/mn10300-linux-tdep.c
+--- insight-7.4.50.orig/gdb/mn10300-linux-tdep.c	2012-01-04 09:17:08.000000000 +0100
++++ insight-7.4.50.new/gdb/mn10300-linux-tdep.c	2012-07-20 12:28:25.745238368 +0200
+@@ -528,9 +528,9 @@
+ {
+ 	void (*pretcode)(void);
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+ 	struct fpucontext fpuctx;
+ 	char retcode[8];
+diff -Naur insight-7.4.50.orig/gdb/tic6x-linux-tdep.c insight-7.4.50.new/gdb/tic6x-linux-tdep.c
+--- insight-7.4.50.orig/gdb/tic6x-linux-tdep.c	2012-01-04 09:27:56.000000000 +0100
++++ insight-7.4.50.new/gdb/tic6x-linux-tdep.c	2012-07-20 12:27:03.857473919 +0200
+@@ -34,7 +34,7 @@
+ 
+ /* The offset from rt_sigframe pointer to SP register.  */
+ #define TIC6X_SP_RT_SIGFRAME 8
+-/* Size of struct siginfo info.  */
++/* Size of siginfo_t info.  */
+ #define TIC6X_SIGINFO_SIZE 128
+ /* Size of type stack_t, which contains three fields of type void*, int, and
+    size_t respectively.  */
diff --git a/insight.spec b/insight.spec
index e2fe4b6..cc3dd6c 100644
--- a/insight.spec
+++ b/insight.spec
@@ -14,7 +14,7 @@
 
 Name:		insight
 Version:	%(echo %{ver} | tr - .)
-Release:	1.%{snap}cvs%{?dist}
+Release:	4.%{snap}cvs%{?dist}
 Summary:	Graphical debugger based on GDB
 License:	GPLv3+
 Group:		Development/Debuggers
@@ -29,28 +29,30 @@ Provides:	bundled(binutils) = %{snap}
 Provides:	bundled(gnulib) = %{snap}
 Provides:	bundled(libiberty) = %{snap}
 Provides:	bundled(md5-gcc) = %{snap}
-BuildRequires:	tcl-devel
-BuildRequires:	tk-devel
-BuildRequires:	itcl-devel >= 3.3
-BuildRequires:	itk-devel >= 3.3
+BuildRequires:	tcl-devel%{?_isa}
+BuildRequires:	tk-devel%{?_isa}
+BuildRequires:	itcl-devel%{?_isa} >= 3.3
+BuildRequires:	itk-devel%{?_isa} >= 3.3
 BuildRequires:	iwidgets
-BuildRequires:	ncurses-devel
-BuildRequires:	readline-devel >= 6.0
-BuildRequires:	expat-devel
-BuildRequires:	ImageMagick
-BuildRequires:	desktop-file-utils
-BuildRequires:	autogen
+BuildRequires:	ncurses-devel%{?_isa}
+BuildRequires:	readline-devel%{?_isa} >= 6.0
+BuildRequires:	expat-devel%{?_isa}
+BuildRequires:	python-devel%{?_isa}
+BuildRequires:	ImageMagick%{?_isa}
+BuildRequires:	desktop-file-utils%{?_isa}
+BuildRequires:	autogen%{?_isa}
 BuildRequires:	automake
 BuildRequires:	autoconf
-BuildRequires:	bison
-BuildRequires:	flex
-BuildRequires:	texinfo
+BuildRequires:	bison%{?_isa}
+BuildRequires:	flex%{?_isa}
+BuildRequires:	texinfo%{?_isa}
 Patch1:		insight-7.4.50-relocate.patch
 Patch2:		insight-7.4.50-readline-system.patch
 Patch3:		insight-7.4.50-unbundle.patch
 Patch4:		insight-7.4.50-acversion.patch
 Patch5:		insight-7.4.50-sig2dead.patch
 Patch6:		insight-7.4.50-sizesizet.patch
+Patch7:		insight-7.4.50-objalloc.patch
 
 #	Some patches from gdb.
 
@@ -96,6 +98,11 @@ Patch138:	gdb-glibc-vdso-workaround.patch
 Patch139:	insight-7.4.50-x86-onstack-1of2.patch
 Patch140:	gdb-x86-onstack-2of2.patch
 
+#	Patches to apply after gdb patches.
+
+Patch200:	insight-7.4.50-structsiginfo.patch
+
+
 %description
  Insight is a tight graphical user interface to GDB written in Tcl/Tk.
 It provides a comprehensive interface that enables users to harness
@@ -115,6 +122,7 @@ GDB version 6.x.
 %patch4 -p1 -b .acversion
 %patch5 -p1 -b .sig2dead
 %patch6 -p1 -b .sizesizet
+%patch7 -p1 -b .objalloc
 
 %patch100 -p 1 -b .ppc64syscall
 %patch101 -p 1 -b .ppc64displaysymbol
@@ -158,6 +166,8 @@ GDB version 6.x.
 %patch139 -p 1 -b .x86-onstack-1of2
 %patch140 -p 1 -b .x86-onstack-2of2
 
+%patch200 -p 1 -b .structsiginfo
+
 
 #-------------------------------------------------------------------------------
 %build
@@ -203,6 +213,7 @@ done
 		--with-expat						\
 		--with-tclinclude="${TCL_SRC_DIR}"			\
 		--with-tkinclude="${TK_SRC_DIR}"			\
+		--with-python=yes					\
 %ifarch ia64
 		--with-libunwind					\
 %else
@@ -295,6 +306,14 @@ rm -rf "${RPM_BUILD_ROOT}"
 %changelog
 #-------------------------------------------------------------------------------
 
+* Thu Nov 15 2012 Patrick Monnerat <pm at datasphere.ch> 7.4.50-4.20120403cvs
+- Path "objalloc" to fix libiberty security bug CVE-2012-3509.
+  https://bugzilla.redhat.com/show_bug.cgi?id=877014
+- Enable Python to support STL extensions.
+  https://bugzilla.redhat.com/show_bug.cgi?id=865554
+- Patch "structsiginfo" to replace occurrences of "struct siginfo" by
+  "siginfo_t".
+
 * Tue Apr  3 2012 Patrick Monnerat <pm at datasphere.ch> 7.4.50-1.20120403cvs
 - New cvs snapshot.
 - Patches imported or adapted from gdb package.


More information about the scm-commits mailing list