From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 039303858028 for ; Tue, 5 Sep 2023 08:44:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 039303858028 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=arista.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arista.com Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-56963f2e48eso1050947a12.1 for ; Tue, 05 Sep 2023 01:44:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; t=1693903438; x=1694508238; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=O1ICkhoq87PdOWjZpYZealp9BzbQcjWAycxRb4c+9VA=; b=bq8601r+5EZ8QMDrh/ZVeZBsNvnvqSBh64guSIsw5cGA647Rkm7BjHUZBF8PGK6+CC tpkuDD9bgG7pEbNUu/Jn7XiS+rANVhH1RSjGm6S3mSqQbOOZ4TQydCMG8zi/elToGevu L4QqXCRWu8H/87B892E2d+UnWz3fYLfft1oQh5YEj5HhE0VuXinIRyHXhLu6FPr7zod4 OJQYfyYMcAiPbtzxO5SSlM81+TT7l0hNDU3YLFT1BuMoVNsKTiAypCsUcpnbavJZadcj mWu9HDvBAX0fGtMwpzzUUkpwtBjn7y785PZT0IUTekiALBSC43HoOQ2Tx92Qx98HFKFH BC0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693903438; x=1694508238; 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=O1ICkhoq87PdOWjZpYZealp9BzbQcjWAycxRb4c+9VA=; b=hjj8/EBOXJfdci2Rk2HBnTt0KjlDx2JeoLetS5tUejls/7TCMcufNTv7LMp/9iEmzE 5z1P51WnrLvvWPGkOsqo1q9mpErWqq5wgkCtTP2f6G01Kq4513XllDjtCWghyiQTYZfg H8igayQyeWzBHXSBvgpB92YxzNNbsMJdyUWDBf+B0wrFoTZ2shH5IdZ/jFDb7Y+gsbI8 YY57ItIbuG+P+HC1JTUfIfRHCQL9ki8w5WeXbOmrdMeP5FktAx0uYRJ8OIyXsAVwCbmi /9/aVA3PIBYtD6sXxC0mx1TClnNROVOufvCECRhGP3NbC7fLBCvNIXBlP+QLfSUcu9ld /nGw== X-Gm-Message-State: AOJu0YwAEJcM1zawsp5BgHBbJ05w7dA1/psPE3LUGmRFs/fMLlEw8Sf1 GNcPic/eIyEcm5Nl/ycbwKnAsfs/GMnotAVy7h/h5g== X-Google-Smtp-Source: AGHT+IFAjgqpVos/UFI+ZP9QDW1xWEIKY6nJbld1zDA3X7deyrMdnR2RO+aKl7V+JoqRA6DhpLJyLwetIcrsWkNxsyQ= X-Received: by 2002:a17:90a:43e1:b0:271:9c57:1c9a with SMTP id r88-20020a17090a43e100b002719c571c9amr9062282pjg.21.1693903438280; Tue, 05 Sep 2023 01:43:58 -0700 (PDT) MIME-Version: 1.0 References: <20230904170332.398424-1-peadar@arista.com> In-Reply-To: From: Peter Edwards Date: Tue, 5 Sep 2023 09:43:46 +0100 Message-ID: Subject: Re: [PATCH v2] elf: Avoid pointer-arithmetic underflow in ldconfig To: Paul Eggert Cc: schwab@suse.de, libc-alpha@sourceware.org Content-Type: multipart/alternative; boundary="000000000000b967b7060498a00f" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: --000000000000b967b7060498a00f Content-Type: text/plain; charset="UTF-8" On Tue, 5 Sept 2023 at 00:51, Paul Eggert wrote: > Attached is a proposed patch to fix the bugs I saw, including the bug > you noticed. I'd appreciate your looking over it since you're familiar > with this code. I am a novice here - I first saw this code the other day, but for what my opinion is worth, the patch looks fine to me, modulo the same issue Andreas has - if we're doing pointer arithmetic in the host environment, I think it's more appropriate to use offset types natural to the host environment, rather than the ElfXX_ types for the elf class we're looking at. The unused PT_INTERP and I assume accidental lack of a break was a nice catch. --000000000000b967b7060498a00f--