From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id BD1FB398A439 for ; Thu, 10 Jun 2021 10:44:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD1FB398A439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id D61F172C8B0 for ; Thu, 10 Jun 2021 13:44:00 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id C7AF37CF723; Thu, 10 Jun 2021 13:44:00 +0300 (MSK) Date: Thu, 10 Jun 2021 13:44:00 +0300 From: "Dmitry V. Levin" To: elfutils-devel@sourceware.org Subject: Re: [PATCH] libdwfl: fix crash when reading link map Message-ID: <20210610104400.GB9340@altlinux.org> References: <9d6fa5673b548c600c23005388bb5e909983acb1.1623285930.git.osandov@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d6fa5673b548c600c23005388bb5e909983acb1.1623285930.git.osandov@fb.com> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 10:44:03 -0000 On Wed, Jun 09, 2021 at 05:45:57PM -0700, Omar Sandoval wrote: > From: Omar Sandoval > > When read_addrs() was converted was converted from a nested function to > a normal function, there was a mistake in converting "buffer" from a > closure variable to a parameter: we are checking whether the pointer > argument is NULL, not whether the buffer itself is NULL. This causes a > NULL pointer dereference when we try to use the NULL buffer later. > > Fixes: 3bf41d458fb6 ("link_map: Pull read_addrs() into file scope") made > Signed-off-by: Omar Sandoval Applied, thanks. -- ldv