From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122691 invoked by alias); 8 Feb 2017 21:59:07 -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 122662 invoked by uid 89); 8 Feb 2017 21:59:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=shorne@gmail.com, shornegmailcom, H*f:CAH, H*i:CAH X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-io0-f194.google.com Received: from mail-io0-f194.google.com (HELO mail-io0-f194.google.com) (209.85.223.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Feb 2017 21:58:55 +0000 Received: by mail-io0-f194.google.com with SMTP id c80so344570iod.1; Wed, 08 Feb 2017 13:58:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=o1S/oqomFinout4y045Ef2L22MxdTNbh9auI76XNcFY=; b=OUi1juzyAwYf8uoonp5UxCsY5xCF9VtaXnmNPY5WV88t07gloD7b2rzcwBJOlBy+ld 9I1lB7F8pmK/+34kUGmo89WWqvvtL47/TSkm9c/T4pvPF2OAHHyMefYvUgb1tevAUOTo hl9b+n+XABaHz+Lrnpe0En8C4HjzRrcycu4wxPGhCzS6niTraEy+apJ2z+JckTna26M/ LXRyU7qzuMqJWNhyML2JhRxsdCko8Trgs3ML9UmRqHcOy3q3vtEzPBtykMdtF6LxtOmJ 0MXYHT0G144x0P5Y4hOSJ+3FtcEk/6Kuksn9yk2k7Xcp1P7XsTnQWhxrht1DeZrttK2C D96A== X-Gm-Message-State: AIkVDXLQXp5B1dxtXy5Pz3gAwmsfybXTUDiqx4XzHiDo5A5enIQClKTN/DUNL6nHNb19HA== X-Received: by 10.98.44.10 with SMTP id s10mr28760728pfs.161.1486591133795; Wed, 08 Feb 2017 13:58:53 -0800 (PST) Received: from localhost (z192.124-44-186.ppp.wakwak.ne.jp. [124.44.186.192]) by smtp.gmail.com with ESMTPSA id z77sm22808106pfk.47.2017.02.08.13.58.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Feb 2017 13:58:53 -0800 (PST) Date: Wed, 08 Feb 2017 21:59:00 -0000 From: Stafford Horne To: Yao Qi Cc: Binutils , "gdb-patches@sourceware.org" Subject: Re: [PATCH] cgen: opcodes: Fix memory corruption in in lookup Message-ID: <20170208215848.GK32144@lianli.shorne-pla.net> References: <20170208164027.17843-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00205.txt.bz2 Hi Yao, On Wed, Feb 08, 2017 at 05:01:05PM +0000, Yao Qi wrote: > Hi Stafford, > opcodes/ changes should be reviewed in binutils@sourceware.org. Right, it was late when I sent this and I was working on a gdb bug. So just sent it here. Resent now to binutils list. > On Wed, Feb 8, 2017 at 4:40 PM, Stafford Horne wrote: > > The buf variable is used after it is free'd. This causes the lookups to > > fail and also causes memory corruption. > > > > Re-arrange the code a bit to make sure we always free memory before > > returning. This was caught in openrisc testing, one of the only user of > > this method. > > > > opcodes/ChangeLog: > > > > 2017-02-09 Stafford Horne > > cgen-opc.c (cgen_lookup_insn): Fix memory corruption issue. > > ChangeLog format issue, > > 017-02-09 Stafford Horne > > * cgen-opc.c (cgen_lookup_insn): Fix memory corruption issue. Thanks, -Stafford