From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cyan.elm.relay.mailchannels.net (cyan.elm.relay.mailchannels.net [23.83.212.47]) by sourceware.org (Postfix) with ESMTPS id 3EE8C3848406 for ; Wed, 9 Jun 2021 06:02:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3EE8C3848406 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 345C57E28B0; Wed, 9 Jun 2021 06:02:07 +0000 (UTC) Received: from pdx1-sub0-mail-a10.g.dreamhost.com (100-96-16-78.trex.outbound.svc.cluster.local [100.96.16.78]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id AADB77E2A27; Wed, 9 Jun 2021 06:02:06 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a10.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.16.78 (trex/6.3.1); Wed, 09 Jun 2021 06:02:07 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Skirt-Chemical: 098295983ddb78b0_1623218527026_4047571286 X-MC-Loop-Signature: 1623218527026:2718333763 X-MC-Ingress-Time: 1623218527026 Received: from pdx1-sub0-mail-a10.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a10.g.dreamhost.com (Postfix) with ESMTP id 698BB7EFCF; Tue, 8 Jun 2021 23:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gotplt.org; h=subject:to :cc:references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=gotplt.org; bh=xTH7u5 PTuJPYY5SY/MU+icZzOls=; b=HsVmM75qAkIFbwNPPHWyJkwkvZfpNSEiWLO3oq o+DknGd9YsdOI1LEPK1mfXDGxDB3vPEiDHpGXTJ3Y2qJwG5iZyYOQjA2/VF6NQ6J SRc/9jQZSwn1LU9f4t5HZ5INTDXaeZmbSkK07HAZXISyhIa94kIXTchjgt0r7oNX 3TlTE= Received: from [192.168.1.126] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a10.g.dreamhost.com (Postfix) with ESMTPSA id 979A57EFCC; Tue, 8 Jun 2021 23:02:04 -0700 (PDT) Subject: Re: [PATCH v1] x86: memcmp-avx2-movbe.S and memcmp-evex-movbe.S fix overflow bug. To: Noah Goldstein Cc: Paul Eggert , GNU C Library References: <20210607083011.855616-1-goldstein.w.n@gmail.com> <8690911e-3cac-836b-2a8a-8b5b2ca74b02@cs.ucla.edu> <263a051d-8807-64b6-989e-f1ee3d03055a@gotplt.org> X-DH-BACKEND: pdx1-sub0-mail-a10 From: Siddhesh Poyarekar Message-ID: <87ea4f71-3b06-1259-5663-ce8a8db72279@gotplt.org> Date: Wed, 9 Jun 2021 11:31:59 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3029.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: Wed, 09 Jun 2021 06:02:10 -0000 On 6/9/21 11:13 AM, Noah Goldstein wrote: > Got it and thanks! Sorry for all the questions. > > Was a bit thrown off because we have overflow tests for strncat / strnlen > so it appears we are testing UB. Hmm, I couldn't spot any overflow tests from a quick skim; there are tests that set maxlen as SIZE_MAX (but should terminate before reaching SIZE_MAX and hence not cause an overflow) and page boundary tests in strnlen, but none of them should result in undefined behaviour. Could you point out the ones that invoke undefined behaviour? Thanks, Siddhesh