summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorghen <ghen@pkgsrc.org>2007-07-28 22:57:12 +0000
committerghen <ghen@pkgsrc.org>2007-07-28 22:57:12 +0000
commit557392fd3f1e43b3275d536de00f8330f566b692 (patch)
tree54e168ca6862f6e863062b81cb5f31a60b2c8648
parent55ead650c96fbb12fa778d80e8614a0b9117d663 (diff)
downloadpkgsrc-557392fd3f1e43b3275d536de00f8330f566b692.tar.gz
Pullup ticket 2134 - requested by lkundrak
security fix for gdb - pkgsrc/devel/gdb/Makefile 1.34 - pkgsrc/devel/gdb/distinfo 1.9-1.10 - pkgsrc/devel/gdb/patches/patch-am 1.2 - pkgsrc/devel/gdb/patches/patch-ap 1.1 - pkgsrc/devel/gdb/patches/patch-aq 1.1 Module Name: pkgsrc Committed By: lkundrak Date: Tue Jul 3 12:41:19 UTC 2007 Modified Files: pkgsrc/devel/gdb: Makefile distinfo Added Files: pkgsrc/devel/gdb/patches: patch-ap patch-aq Log Message: Fixes for CVE-2005-1704 and CVE-2005-1705. Bump PKGREVISION. --- Module Name: pkgsrc Committed By: lkundrak Date: Wed Jul 11 13:12:02 UTC 2007 Modified Files: pkgsrc/devel/gdb: distinfo pkgsrc/devel/gdb/patches: patch-am Log Message: Attempt to fix build on >1.6
-rw-r--r--devel/gdb/Makefile4
-rw-r--r--devel/gdb/distinfo6
-rw-r--r--devel/gdb/patches/patch-am43
-rw-r--r--devel/gdb/patches/patch-ap75
-rw-r--r--devel/gdb/patches/patch-aq15
5 files changed, 137 insertions, 6 deletions
diff --git a/devel/gdb/Makefile b/devel/gdb/Makefile
index 89c33e615db..e181fe2a576 100644
--- a/devel/gdb/Makefile
+++ b/devel/gdb/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.33 2007/03/23 15:18:23 joerg Exp $
+# $NetBSD: Makefile,v 1.33.4.1 2007/07/28 22:57:12 ghen Exp $
#
DISTNAME= gdb-5.3
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GNU:=gdb/}
diff --git a/devel/gdb/distinfo b/devel/gdb/distinfo
index 839421d91f3..a37931e9b5a 100644
--- a/devel/gdb/distinfo
+++ b/devel/gdb/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2006/10/22 07:55:38 rillig Exp $
+$NetBSD: distinfo,v 1.8.6.1 2007/07/28 22:57:12 ghen Exp $
SHA1 (gdb-5.3.tar.gz) = 24a6c9da6e89b1b82b7508f27f94098d989ff662
RMD160 (gdb-5.3.tar.gz) = 3f88dc11115de08708c50c73b10acaf00ed25e96
@@ -15,6 +15,8 @@ SHA1 (patch-ai) = 24fc619a5de034c4ead6424ffcb30a2e8aa7d816
SHA1 (patch-aj) = 16b03a5ce9b34af42dcec4e26103ebc456d091bf
SHA1 (patch-ak) = 0908ff7f7000df702a18c25bce4b4930c61ad8f8
SHA1 (patch-al) = 2721abee837d85f57b05073490d94e9e11d5193d
-SHA1 (patch-am) = 8bb74176c2e7042a74330a02d60a1976919da2a0
+SHA1 (patch-am) = 73c6077dcad00fbdde289d270418bd66a36ae9d9
SHA1 (patch-an) = c28777296917daa1a619eca092023c8f5aaf706f
SHA1 (patch-ao) = 7a38b55945cf6d9fc422e460d67b88a1e4416e62
+SHA1 (patch-ap) = e79d8a70d12098716791e3349d8606d07f8acd47
+SHA1 (patch-aq) = f7c356f7c500b84feb141ba693390378e5f71642
diff --git a/devel/gdb/patches/patch-am b/devel/gdb/patches/patch-am
index 7c164bf946f..6121f70d39f 100644
--- a/devel/gdb/patches/patch-am
+++ b/devel/gdb/patches/patch-am
@@ -1,6 +1,6 @@
-$NetBSD: patch-am,v 1.1 2006/02/27 15:45:29 joerg Exp $
+$NetBSD: patch-am,v 1.1.12.1 2007/07/28 22:57:12 ghen Exp $
---- gdb/i386bsd-nat.c.orig 2006-02-27 14:51:46.000000000 +0000
+--- gdb/i386bsd-nat.c.orig 2007-07-11 14:32:16.000000000 +0200
+++ gdb/i386bsd-nat.c
@@ -395,7 +395,7 @@ _initialize_i386bsd_nat (void)
system header files and sysctl(3) to get at the relevant
@@ -11,3 +11,42 @@ $NetBSD: patch-am,v 1.1 2006/02/27 15:45:29 joerg Exp $
extern int i386fbsd4_sc_pc_offset;
extern int i386fbsd4_sc_sp_offset;
#define SC_PC_OFFSET i386fbsd4_sc_pc_offset
+@@ -419,26 +419,30 @@ _initialize_i386bsd_nat (void)
+
+ /* Override the default value for the offset of the program counter
+ in the sigcontext structure. */
+- sc_pc_offset = offsetof (struct sigcontext, sc_pc);
++#if defined(__DragonFly__)
++ sc_pc_offset = offsetof (ucontext_t, uc_mcontext.mc_eip);
++#else
++ sc_pc_offset = offsetof (ucontext_t, uc_mcontext.__gregs[_REG_EIP]);
++#endif
+
+ if (SC_PC_OFFSET != sc_pc_offset)
+ {
+- warning ("\
+-offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\
+-Please report this to <bug-gdb@gnu.org>.",
++ warning ("sc_pc_offset is %d instead of %d.",
+ sc_pc_offset, SC_PC_OFFSET);
+ }
+
+ SC_PC_OFFSET = sc_pc_offset;
+
+ /* Likewise for the stack pointer. */
+- sc_sp_offset = offsetof (struct sigcontext, sc_sp);
++#if defined(__DragonFly__)
++ sc_sp_offset = offsetof (ucontext_t, uc_mcontext.mc_esp);
++#else
++ sc_sp_offset = offsetof (ucontext_t, uc_mcontext.__gregs[_REG_UESP]);
++#endif
+
+ if (SC_SP_OFFSET != sc_sp_offset)
+ {
+- warning ("\
+-offsetof (struct sigcontext, sc_sp) yields %d instead of %d.\n\
+-Please report this to <bug-gdb@gnu.org>.",
++ warning ("sc_sp_offset is %d instead of %d.",
+ sc_sp_offset, SC_SP_OFFSET);
+ }
+
diff --git a/devel/gdb/patches/patch-ap b/devel/gdb/patches/patch-ap
new file mode 100644
index 00000000000..727e18c3750
--- /dev/null
+++ b/devel/gdb/patches/patch-ap
@@ -0,0 +1,75 @@
+$NetBSD: patch-ap,v 1.1.2.2 2007/07/28 22:57:13 ghen Exp $
+
+Patch for CVE-2005-1704 sucked from upstream.
+* elfcode.h (elf_object_p): Add more sanity checks on elf header.
+
+--- bfd/elfcode.h.orig 2002-07-07 11:10:39.000000000 +0200
++++ bfd/elfcode.h
+@@ -683,8 +683,13 @@ elf_object_p (abfd)
+
+ if (i_ehdrp->e_shoff != 0)
+ {
++ bfd_signed_vma where = i_ehdrp->e_shoff;
++
++ if (where != (file_ptr) where)
++ goto got_wrong_format_error;
++
+ /* Seek to the section header table in the file. */
+- if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0)
++ if (bfd_seek (abfd, (file_ptr) where, SEEK_SET) != 0)
+ goto got_no_match;
+
+ /* Read the first section header at index 0, and convert to internal
+@@ -697,13 +702,50 @@ elf_object_p (abfd)
+ /* If the section count is zero, the actual count is in the first
+ section header. */
+ if (i_ehdrp->e_shnum == SHN_UNDEF)
+- i_ehdrp->e_shnum = i_shdr.sh_size;
++ {
++ i_ehdrp->e_shnum = i_shdr.sh_size;
++ if (i_ehdrp->e_shnum != i_shdr.sh_size)
++ goto got_wrong_format_error;
++ }
+
+ /* And similarly for the string table index. */
+ if (i_ehdrp->e_shstrndx == SHN_XINDEX)
+- i_ehdrp->e_shstrndx = i_shdr.sh_link;
++ {
++ i_ehdrp->e_shstrndx = i_shdr.sh_link;
++ if (i_ehdrp->e_shstrndx != i_shdr.sh_link)
++ goto got_wrong_format_error;
++ }
++
++ /* Sanity check that we can read all of the section headers.
++ It ought to be good enough to just read the last one. */
++ if (i_ehdrp->e_shnum != 1)
++ {
++ /* Check that we don't have a totally silly number of sections. */
++ if (i_ehdrp->e_shnum > (unsigned int) -1 / sizeof (x_shdr))
++ goto got_wrong_format_error;
++
++ where += (i_ehdrp->e_shnum - 1) * sizeof (x_shdr);
++ if (where != (file_ptr) where)
++ goto got_wrong_format_error;
++ if ((bfd_size_type) where <= i_ehdrp->e_shoff)
++ goto got_wrong_format_error;
++
++ if (bfd_seek (abfd, (file_ptr) where, SEEK_SET) != 0)
++ goto got_no_match;
++ if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr))
++ goto got_no_match;
++
++ /* Back to where we were. */
++ where = i_ehdrp->e_shoff + sizeof (x_shdr);
++ if (bfd_seek (abfd, (file_ptr) where, SEEK_SET) != 0)
++ goto got_no_match;
++ }
+ }
+
++ /* A further sanity check. */
++ if (i_ehdrp->e_shstrndx >= i_ehdrp->e_shnum)
++ goto got_wrong_format_error;
++
+ /* Allocate space for a copy of the section header table in
+ internal form. */
+ if (i_ehdrp->e_shnum != 0)
diff --git a/devel/gdb/patches/patch-aq b/devel/gdb/patches/patch-aq
new file mode 100644
index 00000000000..7bbadca30c4
--- /dev/null
+++ b/devel/gdb/patches/patch-aq
@@ -0,0 +1,15 @@
+$NetBSD: patch-aq,v 1.1.2.2 2007/07/28 22:57:13 ghen Exp $
+
+Patch for CVE-2005-1705 from Gentoo #88398.
+
+--- gdb/main.c.orig 2002-09-28 17:10:31.000000000 +0200
++++ gdb/main.c
+@@ -626,7 +626,7 @@ extern int gdbtk_test (char *);
+
+ if (!homedir
+ || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
+- if (!inhibit_gdbinit)
++ if (!inhibit_gdbinit && (cwdbuf.st_uid == getuid()) && (!cwdbuf.st_mode & (S_IWOTH)))
+ {
+ catch_command_errors (source_command, gdbinit, 0, RETURN_MASK_ALL);
+ }