From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18610 invoked by alias); 9 Jan 2014 19:03:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18590 invoked by uid 89); 9 Jan 2014 19:03:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Jan 2014 19:03:33 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s09J3RNZ013219 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 9 Jan 2014 14:03:28 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s09J3PLG002947; Thu, 9 Jan 2014 14:03:25 -0500 Message-ID: <52CEF27C.5040403@redhat.com> Date: Thu, 09 Jan 2014 19:03:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Roland McGrath CC: "H.J. Lu" , "binutils@sourceware.org" , GDB , Bradley Nelson Subject: Re: [PATCH] Fix buffer underrun in i386-dis.c. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00257.txt.bz2 On 01/09/2014 06:31 PM, H.J. Lu wrote: > On Thu, Jan 9, 2014 at 10:26 AM, Roland McGrath wrote: >> When disassembling any instruction without a REX prefix, the print_insn >> function touches all_prefixes[-1]. This is usually harmless in most >> builds, because the word preceding all_prefixes will probably be the >> last_seg_prefix variable and it was usually zero already. But in some >> kinds of builds, all buffer underruns are caught and cause a crash. >> >> AFAICT the obvious local workaround is in fact the proper fix. In the >> similar cases nearby, there is a PREFIX_FOO bit in the "prefixes" bitmask >> that guards use of last_foo_prefix. But there is no such bit for the REX >> prefixes. We could test "rex != 0" instead, I suppose. >> >> OK for trunk and binutils-2.24 branch and gdb-7.7 branch? > > OK for trunk and binutils-2.24 branch. In that case, OK for gdb-7.7 too. -- Pedro Alves