From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id C78983894C22 for ; Mon, 7 Jun 2021 18:07:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C78983894C22 Received: by mail-pg1-x52f.google.com with SMTP id o9so11616145pgd.2 for ; Mon, 07 Jun 2021 11:07:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AShd03phkEOA7BWIxZLEHLC1p5NvevuFjnd3uwPIY5U=; b=VebjkHEGIlMadptTx4XVQye3F/9Ic+y9K380DaPWYGxBBQ8EtbtBwtj8H6uwvH2Vz7 X87S5gzcT0dikEzShca/uGwmPOLWtVV30kSNFSeuUX1o5du2UDe7PZ0mNFntI7PU5l0n hst4NJ+ApLhkoVAYUhx/qSXHbniZAu3f3HsjwrCvWxBn7QfkWt0paUfyKXWETBhkKIac bU7tTCfw6CBQpNeu6CEzDdUm/e7CjA8A6PffrXzIcK5+LW2VXcibH5n5qY3jtzWIFB6Z +sHsF41w5+i9uYTINOP13sgMW0DYGbw910hsNCD33VXCIHoqg7mWMQm5eGFEQMmsJiAz 9/AQ== X-Gm-Message-State: AOAM533ZvnWpXs8bh0TiLnvqFZJrP3R9Qm7ZFw1g0WaFXykkpA/ln4ll 05RwsjtmjEII4ZaekC4KCifSn22VNVsOlCEsgX4= X-Google-Smtp-Source: ABdhPJxbWESwWmO/TvtQQQU/qQneFd8dAr/DliFSIiC1a6O3YT3KFXIIjWB9wfS3Q06hXiymcLIzqWTN3Kz5oJbwg3w= X-Received: by 2002:a65:4bce:: with SMTP id p14mr18692940pgr.408.1623089264968; Mon, 07 Jun 2021 11:07:44 -0700 (PDT) MIME-Version: 1.0 References: <20210607083011.855616-1-goldstein.w.n@gmail.com> <8690911e-3cac-836b-2a8a-8b5b2ca74b02@cs.ucla.edu> In-Reply-To: <8690911e-3cac-836b-2a8a-8b5b2ca74b02@cs.ucla.edu> From: Noah Goldstein Date: Mon, 7 Jun 2021 14:07:34 -0400 Message-ID: Subject: Re: [PATCH v1] x86: memcmp-avx2-movbe.S and memcmp-evex-movbe.S fix overflow bug. To: Paul Eggert Cc: Siddhesh Poyarekar , GNU C Library X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 18:07:47 -0000 On Mon, Jun 7, 2021 at 1:45 PM Paul Eggert wrote: > On 6/7/21 10:28 AM, Noah Goldstein via Libc-alpha wrote: > > > > Is it actually UB? The caller is not causing overflow. The implementation > > method is. It is possible to implement without overflow. > > The C Standard says that unless otherwise specified, when you pass an > array (pointer + size) to a standard function, all the addresses in the > array must be valid. It's valid if (say) memcmp is multithreaded and > compares the first halves of the two arrays in parallel with comparing > the second halves. > If I understand things correctly this patch isn't fixing a conformance > bug; it's merely a QoI issue, where by "quality" one means "I want this > particular undefined behavior to cause a core dump". > I see. Good to hear there wasn't technically a bug :) What do we want the behavior to be? Generally I would think failing silently can be quite painful for users.