From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by sourceware.org (Postfix) with ESMTPS id 6BA2C3858D32 for ; Thu, 1 Dec 2022 21:13:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6BA2C3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=matician.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=matician.com Received: by mail-pj1-x102f.google.com with SMTP id t17so3030242pjo.3 for ; Thu, 01 Dec 2022 13:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=matician-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Zbk5dO/vcBY3rai9Sv43v4XPL6IOVq/HEKBe8UROPTc=; b=vqOCpRfr7mMtaVyS4bztC4LNfpYFUY4H9pn3geacuU9VMCyMtMUlVBYoaYp8RkZJHc 8aJP34ewU0zOPjyE0ldMEbehpPR+vDrL9B8prYaQDh5QWNB4ZS2vsqkRjc8z+jWItGLq Yr1AKPIuWsNzBUCEWpByC4jHUtT1PpCBL/Nn8Qk7ghllWtVR9Opyb+Rvaa299UUSqp7Q itkiFyxDt+p5l63PB6NlvQmvbdw2bAAk27cR8fOCz5Kz3MMFyU3a6s7aMMFMVgh/ErYA f4fFpqZ6+aRa0utcdBV9j/XpV+HRuOvHIWragmFroC40LwECv1iCuQDsfSU7ScdFE9gJ uImQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Zbk5dO/vcBY3rai9Sv43v4XPL6IOVq/HEKBe8UROPTc=; b=1FwSJzPrYuXnEXvSxUpdVVnQ2yyKG/eK9e92HqwcFdTCdGHL7vvAb/3Y+3lLBbetWc iuxvqo05yJpMOOnc/dygO/y2U49o9A6w7S1+smEeEq2Tal7PNmyplHck+SlaDGCE+T3i 222nOowIV6Mub4g0NHR4SIbtZIMSuycL9DbQB+jEaM/e3353WYHRHXmyVDeiJGo6PmvB cBJxuHp3d3FV/NRijsXLZ+u7NdPVXA2hxvXYzS9EeQbawVekANkYcPUMs2vrwDKOSWW0 Y3TIqik3TINfmxum5CWjswhgmqWByPaLiOSWZIpRXihjFzR+uuslnAAZ93ul23a39PhS rfQw== X-Gm-Message-State: ANoB5pnEot6OfaIYPWYxdapoUO+E+PX8r1HOWTW9Jk952qqLnYAUM81v 40fk5HFtykoYO7MkL6geluqgA8mfX5ECuq9BkooQ5x+rMgc+Og== X-Google-Smtp-Source: AA0mqf6GuMpgmLlQe2sI78Y8imO1CSwZ8a2J46yNKXTfvobZN2/S+BN5JQ/bgsmlFd7IhIKjs2RxnAlbOnu+6wCA+hs= X-Received: by 2002:a17:902:bf06:b0:17b:d6ad:94c8 with SMTP id bi6-20020a170902bf0600b0017bd6ad94c8mr63239748plb.110.1669929196164; Thu, 01 Dec 2022 13:13:16 -0800 (PST) MIME-Version: 1.0 References: <20221129062653.298772-1-gavin@matician.com> <70c0b7df5c6b38492a0655c0ff552453d9dc1f5d.camel@klomp.org> In-Reply-To: From: Gavin Li Date: Thu, 1 Dec 2022 13:13:05 -0800 Message-ID: Subject: Re: [PATCH] libdwfl: Read no more than required to parse dynamic sections To: Mark Wielaard Cc: elfutils-devel@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Awesome, thanks for looking over this. I only have one comment: there's an extra "xlatefrom.d_size = xlatefrom.d_size;" line that should be removed. dwfl_elf_phdr_memory_callback is called from dwfl_link_map_report but if any issues arise, those could be addressed in a separate patch. Best, Gavin On Wed, Nov 30, 2022 at 3:14 PM Mark Wielaard wrote: > > Hi Gavin, > > On Tue, Nov 29, 2022 at 01:48:42PM -0800, Gavin Li wrote: > > I think for the purposes of reading small segments (like PT_DYNAMIC > > and PT_NOTE), we should ignore *buffer_available altogether. > > Thanks for walking me through the code. I think you are right and none > of the buffer_available checks are necessary. So I removed them all. I > also adjusted the commit message a bit. Could you look at this patch > and let me know if this works for you? > > Cheers, > > Mark