From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1NsRHW-0003jI-BS for garchives@archives.gentoo.org; Fri, 19 Mar 2010 01:45:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E1E38E0AC2; Fri, 19 Mar 2010 01:45:45 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 809E7E0AC2 for ; Fri, 19 Mar 2010 01:45:45 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 209481B40F8 for ; Fri, 19 Mar 2010 01:45:45 +0000 (UTC) Received: from vapier by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1NsRHU-0004SD-I6 for gentoo-commits@lists.gentoo.org; Fri, 19 Mar 2010 01:45:44 +0000 From: "Mike Frysinger (vapier)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, vapier@gentoo.org Subject: [gentoo-commits] gentoo commit in src/patchsets/gdb/7.0.1: 05_all_readline-headers.patch 20_all_gdb-tdep-opcode-include-workaround.patch 35_all_gdb-6.3-security-errata-20050610.patch 80_all_gdb-6.5-dwarf-stack-overflow.patch README.history X-VCS-Repository: gentoo X-VCS-Files: 05_all_readline-headers.patch 20_all_gdb-tdep-opcode-include-workaround.patch 35_all_gdb-6.3-security-errata-20050610.patch 80_all_gdb-6.5-dwarf-stack-overflow.patch README.history X-VCS-Directories: src/patchsets/gdb/7.0.1 X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger Content-Type: text/plain; charset=utf8 Message-Id: Sender: Mike Frysinger Date: Fri, 19 Mar 2010 01:45:44 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 7897ac06-63af-4b5e-8de9-95580c36a602 X-Archives-Hash: d1e68adde37fd7dbd663bebaaef7d762 vapier 10/03/19 01:45:44 Added: 05_all_readline-headers.patch 20_all_gdb-tdep-opcode-include-workaround.patch 35_all_gdb-6.3-security-errata-20050610.patch 80_all_gdb-6.5-dwarf-stack-overflow.patch README.history Log: initial 7.0.1 patchset based on last 7.0 patchset Revision Changes Path 1.1 src/patchsets/gdb/7.0.1/05_all_readline-headers.patc= h file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/05_all_readline-headers.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/05_all_readline-headers.patch?rev=3D1.1&content-type=3Dtext/plain Index: 05_all_readline-headers.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/readline/complete.c +++ b/readline/complete.c @@ -25,6 +25,11 @@ # include #endif =20 +#ifdef HAVE_WCHAR_H /* wcwidth() */ +# define _GNU_SOURCE +# include +#endif + #include #include #if defined (HAVE_SYS_FILE_H) --- a/readline/display.c +++ b/readline/display.c @@ -25,6 +25,11 @@ # include #endif =20 +#ifdef HAVE_WCHAR_H /* wcwidth() */ +# define _GNU_SOURCE +# include +#endif + #include =20 #if defined (HAVE_UNISTD_H) --- a/readline/mbutil.c +++ b/readline/mbutil.c @@ -25,6 +25,11 @@ # include #endif =20 +#ifdef HAVE_WCHAR_H /* wcwidth() */ +# define _GNU_SOURCE +# include +#endif + #include #include #include "posixjmp.h" 1.1 src/patchsets/gdb/7.0.1/20_all_gdb-tdep-opcode-inclu= de-workaround.patch file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/20_all_gdb-tdep-opcode-include-workaround.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/20_all_gdb-tdep-opcode-include-workaround.patch?rev=3D1.1&content-type=3D= text/plain Index: 20_all_gdb-tdep-opcode-include-workaround.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D workaround build failure http://bugs.gentoo.org/216368 http://bugs.gentoo.org/299600 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -32,7 +32,7 @@ #include "gdb_assert.h" #include "sim-regno.h" #include "gdb/sim-frv.h" -#include "opcodes/frv-desc.h" /* for the H_SPR_... enums */ +#include "../opcodes/frv-desc.h" /* for the H_SPR_... enums */ #include "symtab.h" #include "elf-bfd.h" #include "elf/frv.h" --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -53,8 +53,8 @@ =20 /* Get the user's customized MeP coprocessor register names from libopcodes. */ -#include "opcodes/mep-desc.h" -#include "opcodes/mep-opc.h" +#include "../opcodes/mep-desc.h" +#include "../opcodes/mep-opc.h" =20 =0C /* The gdbarch_tdep structure. */ --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -35,7 +35,7 @@ #include "regcache.h" #include "trad-frame.h" #include "reggroups.h" -#include "opcodes/lm32-desc.h" +#include "../opcodes/lm32-desc.h" =20 #include "gdb_string.h" =20 1.1 src/patchsets/gdb/7.0.1/35_all_gdb-6.3-security-erra= ta-20050610.patch file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/35_all_gdb-6.3-security-errata-20050610.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/35_all_gdb-6.3-security-errata-20050610.patch?rev=3D1.1&content-type=3D= text/plain Index: 35_all_gdb-6.3-security-errata-20050610.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D http://sourceware.org/ml/gdb-patches/2005-05/threads.html#00637 Proposed upstream but never committed upstream. 2005-06-09 Jeff Johnston * gdb.base/gdbinit.exp: New testcase. * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp. 2005-06-08 Daniel Jacobowitz Jeff Johnston * Makefile.in (cli-cmds.o): Update. * configure.in: Add check for getuid. * configure: Regenerated. * config.in: Ditto. * main.c (captured_main): Pass -1 to source_command when loading gdbinit files. * cli/cli-cmds.c: Include "gdb_stat.h" and . (source_command): Update documentation. Check permissions if FROM_TTY is -1. Index: gdb-6.8.50.20090226/gdb/cli/cli-cmds.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gdb-6.8.50.20090226.orig/gdb/cli/cli-cmds.c 2009-02-27 00:04:32.00000= 0000 +0100 +++ gdb-6.8.50.20090226/gdb/cli/cli-cmds.c 2009-02-28 07:17:49.000000000 = +0100 @@ -36,6 +36,7 @@ #include "objfiles.h" #include "source.h" #include "disasm.h" +#include "gdb_stat.h" =20 #include "ui-out.h" =20 @@ -466,7 +467,7 @@ source_script (char *file, int from_tty) =20 if (fd =3D=3D -1) { - if (from_tty) + if (from_tty > 0) perror_with_name (file); else { @@ -475,6 +476,29 @@ source_script (char *file, int from_tty) } } =20 +#ifdef HAVE_GETUID + if (from_tty =3D=3D -1) + { + struct stat statbuf; + + if (fstat (fd, &statbuf) < 0) + { + close (fd); + /* Do not do_cleanups (old_cleanups) as FILE is allocated there. + perror_with_name calls error which should call the cleanups. */ + perror_with_name (file); + } + if (statbuf.st_uid !=3D getuid () || (statbuf.st_mode & S_IWOTH)) + { + /* FILE gets freed by do_cleanups (old_cleanups). */ + warning (_("not using untrusted file \"%s\""), file); + close (fd); + do_cleanups (old_cleanups); + return; + } + } +#endif + stream =3D fdopen (fd, FOPEN_RT); script_from_file (stream, file); =20 @@ -486,6 +510,7 @@ source_script (char *file, int from_tty) else script_from_file (stream, file); =20 + /* FILE gets freed by do_cleanups (old_cleanups). */ do_cleanups (old_cleanups); } =20 Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.exp 2009-02-28 07:= 15:57.000000000 +0100 @@ -0,0 +1,98 @@ +# Copyright 2005 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +#=20 +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +#=20 +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, = USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# This file was written by Jeff Johnston . + +if $tracelevel then { + strace $tracelevel +} + +set prms_id 0 +set bug_id 0 + +# are we on a target board +if [is_remote target] { + return +} + + +global verbose +global GDB +global GDBFLAGS +global gdb_prompt +global timeout +global gdb_spawn_id; + +gdb_stop_suppressing_tests; + +verbose "Spawning $GDB -nw" + +if [info exists gdb_spawn_id] { + return 0; +} + +if ![is_remote host] { + if { [which $GDB] =3D=3D 0 } then { + perror "$GDB does not exist." + exit 1 + } +} + +set env(HOME) [pwd] +remote_exec build "rm .gdbinit" +remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit" +remote_exec build "chmod 646 .gdbinit" + +set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; +if { $res < 0 || $res =3D=3D "" } { + perror "Spawning $GDB failed." + return 1; +} +gdb_expect 360 { + -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prom= pt $" { + pass "untrusted .gdbinit caught." + } + -re "$gdb_prompt $" { + fail "untrusted .gdbinit caught." + } + timeout { + fail "(timeout) untrusted .gdbinit caught." + } +} + +remote_exec build "chmod 644 .gdbinit" +set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; +if { $res < 0 || $res =3D=3D "" } { + perror "Spawning $GDB failed." + return 1; +} +gdb_expect 360 { + -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prom= pt $" { + fail "trusted .gdbinit allowed." + } + -re "in gdbinit.*$gdb_prompt $" { + pass "trusted .gdbinit allowed." + } + timeout { + fail "(timeout) trusted .gdbinit allowed." + } +} + +remote_exec build "rm .gdbinit" Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.sample =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ gdb-6.8.50.20090226/gdb/testsuite/gdb.base/gdbinit.sample 2009-02-28 = 07:15:57.000000000 +0100 @@ -0,0 +1 @@ +echo "\nin gdbinit" Index: gdb-6.8.50.20090226/gdb/main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gdb-6.8.50.20090226.orig/gdb/main.c 2009-02-27 00:04:32.000000000 +01= 00 +++ gdb-6.8.50.20090226/gdb/main.c 2009-02-28 07:15:57.000000000 +0100 @@ -855,7 +855,7 @@ Excess command line arguments ignored. ( debugging or what directory you are in. */ =20 if (home_gdbinit && !inhibit_gdbinit) - catch_command_errors (source_script, home_gdbinit, 0, RETURN_MASK_AL= L); + catch_command_errors (source_script, home_gdbinit, -1, RETURN_MASK_A= LL); =20 /* Now perform all the actions indicated by the arguments. */ if (cdarg !=3D NULL) @@ -924,7 +924,7 @@ Can't attach to process and specify a co /* Read the .gdbinit file in the current directory, *if* it isn't the same as the $HOME/.gdbinit file (it should exist, also). */ if (local_gdbinit && !inhibit_gdbinit) - catch_command_errors (source_script, local_gdbinit, 0, RETURN_MASK_A= LL); + catch_command_errors (source_script, local_gdbinit, -1, RETURN_MASK_= ALL); =20 for (i =3D 0; i < ncmd; i++) { 1.1 src/patchsets/gdb/7.0.1/80_all_gdb-6.5-dwarf-stack-o= verflow.patch file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/80_all_gdb-6.5-dwarf-stack-overflow.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/80_all_gdb-6.5-dwarf-stack-overflow.patch?rev=3D1.1&content-type=3Dtext= /plain Index: 80_all_gdb-6.5-dwarf-stack-overflow.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D http://bugs.gentoo.org/144833 for gdb/ChangeLog: 2006-08-22 Will Drewry Tavis Ormandy * dwarf2read.c (decode_locdesc): Enforce location description stack boundaries. * dwarfread.c (locval): Likewise. 2007-10-15 Jan Kratochvil Port to GDB-6.7. Index: gdb-6.7/gdb/dwarf2read.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gdb-6.7.orig/gdb/dwarf2read.c 2007-10-15 00:08:30.000000000 +0200 +++ gdb-6.7/gdb/dwarf2read.c 2007-10-15 21:42:43.000000000 +0200 @@ -9070,8 +9070,7 @@ dwarf2_fundamental_type (struct objfile=20 callers will only want a very basic result and this can become a complaint. =20 - Note that stack[0] is unused except as a default error return. - Note that stack overflow is not yet handled. */ + Note that stack[0] is unused except as a default error return. */ =20 static CORE_ADDR decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) @@ -9088,7 +9087,7 @@ decode_locdesc (struct dwarf_block *blk, =20 i =3D 0; stacki =3D 0; - stack[stacki] =3D 0; + stack[++stacki] =3D 0; =20 while (i < size) { @@ -9270,6 +9269,16 @@ decode_locdesc (struct dwarf_block *blk, dwarf_stack_op_name (op)); return (stack[stacki]); } + /* Enforce maximum stack depth of size-1 to avoid ++stacki writing + outside of the allocated space. Also enforce minimum > 0. + -- wad@google.com 14 Aug 2006 */ + if (stacki >=3D sizeof (stack) / sizeof (*stack) - 1) + internal_error (__FILE__, __LINE__, + _("location description stack too deep: %d"), + stacki); + if (stacki <=3D 0) + internal_error (__FILE__, __LINE__, + _("location description stack too shallow")); } return (stack[stacki]); } 1.1 src/patchsets/gdb/7.0.1/README.history file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/README.history?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gdb/7.0.= 1/README.history?rev=3D1.1&content-type=3Dtext/plain Index: README.history =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1 04.01.2009 + 05_all_readline-headers.patch + 20_all_gdb-tdep-opcode-include-workaround.patch + 35_all_gdb-6.3-security-errata-20050610.patch + 80_all_gdb-6.5-dwarf-stack-overflow.patch