From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 35527385782B for ; Wed, 9 Jun 2021 09:20:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 35527385782B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-d3NJUXJQP5q3QGzHatgXxw-1; Wed, 09 Jun 2021 05:20:24 -0400 X-MC-Unique: d3NJUXJQP5q3QGzHatgXxw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D3BAD801ADE; Wed, 9 Jun 2021 09:20:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-115-60.ams2.redhat.com [10.36.115.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C013610023B5; Wed, 9 Jun 2021 09:20:22 +0000 (UTC) From: Florian Weimer To: Andreas Schwab Cc: Siddhesh Poyarekar , GNU C Library Subject: Re: [PATCH v1] x86: memcmp-avx2-movbe.S and memcmp-evex-movbe.S fix overflow bug. References: <20210607083011.855616-1-goldstein.w.n@gmail.com> <8690911e-3cac-836b-2a8a-8b5b2ca74b02@cs.ucla.edu> <263a051d-8807-64b6-989e-f1ee3d03055a@gotplt.org> <87ea4f71-3b06-1259-5663-ce8a8db72279@gotplt.org> <00e3f10b-9769-306e-7391-b57bd48a1476@gotplt.org> <878s3j1o74.fsf@igel.home> <04ffaefb-79c9-46b7-7cb1-ef687e041ad0@gotplt.org> <87sg1rz9g1.fsf@igel.home> Date: Wed, 09 Jun 2021 11:20:20 +0200 In-Reply-To: <87sg1rz9g1.fsf@igel.home> (Andreas Schwab's message of "Wed, 09 Jun 2021 11:14:22 +0200") Message-ID: <87pmwv75t7.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 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 09:20:30 -0000 * Andreas Schwab: > On Jun 09 2021, Siddhesh Poyarekar wrote: > >> Hmm, I just noticed that wcsnlen is not in the ISO C draft (at least the >> one I have from 2011) and is defined in POSIX. The description doesn't >> seem to specify any access semantics for wcsnlen + maxlen. Are you >> referring to the fact that it's unspecified or are you aware of anywhere >> else in the spec that requires the implementation to ensure valid access? > > Does the sentence "The wcsnlen() function shall never examine more than > the first maxlen characters of the wide-character array pointed to by > ws." constitute a limit on maxlen, or that ws+maxlen must be valid? Is this bug related? wcsrtombs calls wcsnlen on input data which is not an array Thanks, Florian