From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 72D333858018 for ; Thu, 10 Jun 2021 00:51:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 72D333858018 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=osandov.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=osandov.com Received: by mail-pl1-x62c.google.com with SMTP id 11so55603plk.12 for ; Wed, 09 Jun 2021 17:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qlUbhSxYGS++dEbewtODk9CAWKpzObNwpxPRGt+S/n0=; b=BHdGeYgqWY9LoTtnulCjU/xCbn7407Pmj373lU7IsvmS2EXQcH5dWkSltVUJNY0dYr iwko7LBR0fnDFdBMogJeRycoOfnBOBDsPbJz8UHFPwCqrB5ZiZSrd2J+KWSVl+6I2JWB E8eu4738KQOchjO1xLXdBNtltGLdHYH5rgVa5Bs1koSCsgLdr/VF/P4m2WbWL60Q+WKC 2nuxEnZ/uzXEI7vT2BuVyWOElznlfHoxl3UwmWd5sh8uSNvEnijsCQLxb7QWeM7irQPO w3daGoheBiE7ipo+lTTKuBKjcqWz+k9E6lxzDJksc6FwDkTkgC35VzYP9X75dWMq5POD DtBg== 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; bh=qlUbhSxYGS++dEbewtODk9CAWKpzObNwpxPRGt+S/n0=; b=IG3Vp5zBwDgXLD/0Em4NlxOzmKjs2c+AeBWKYw762/l0fd7p1cZvzOJhx1sJRoBx0X g8CzQIaXbuhAnCfuNz+WBnGWP0XmcUsDaI8pMZRTcjKE3GO9gLTw5myrabgxeAMbJiFq a0AdSHON67ealHlvk7P4y1cCt1NymFtFL0G/z7Gv0RFtMbK7KSlDW62Z7zC4o3mwXSsX CknwHpEZCDX3zi9Oh04YFEeSWEeseBqpOirIwLvl25IipOE7FMISgJPiJEc2oVzXcv4Z gIGRMDvQOT0Q4467msxSw5htJlzJpmkk1L5l0n/9ZBQKlhWgp+oZOBqq1lFwmSfmK5VK vYAw== X-Gm-Message-State: AOAM533a3jFuwnDUhgjaOyoh6gxrsQewRi81njh7kKSIdeTqA/o8UXVW QTEzB3HRLansyyjOKBnE4BMMSlO6+ZeyzQ== X-Google-Smtp-Source: ABdhPJzSnXlBnJHynyL1ZIU38JpLbBsEXNnsyDswdhmeATdxKvv+Cdg+IttaE/RjmMGmLjxqAWBltw== X-Received: by 2002:a17:90b:fd4:: with SMTP id gd20mr473928pjb.24.1623286264209; Wed, 09 Jun 2021 17:51:04 -0700 (PDT) Received: from relinquished.localdomain ([2620:10d:c090:400::5:a169]) by smtp.gmail.com with ESMTPSA id bo14sm5881934pjb.40.2021.06.09.17.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 17:51:03 -0700 (PDT) Date: Wed, 9 Jun 2021 17:51:01 -0700 From: Omar Sandoval To: elfutils-devel@sourceware.org Subject: Re: [PATCH] libdwfl: fix crash when reading link map Message-ID: 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=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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 00:51:06 -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 ^^^^ Stray word here, hopefully not too much trouble to fix up when applying.