From nobody Fri Aug 25 19:37:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RXVbT2Y2zz4qj4b for ; Fri, 25 Aug 2023 19:37:41 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RXVbT0ympz3VT8 for ; Fri, 25 Aug 2023 19:37:41 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3fbd33a57b6so11035275e9.2 for ; Fri, 25 Aug 2023 12:37:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692992260; x=1693597060; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ox4G81BDr1lHM/vdblB8TT34Lzj9cw0o8hNr4eibhUE=; b=KPAErHzmD27zIR7bDyvpg9rF8skuOW4ILlHCRgym4h+lZHZmqB912Q010lWdYLsAIW Q3upQjDKmutXLzjFboquEG6KYHTcdjuGRIb+8bKsh6QegJ8imi7iHbMVaWLM8icsnVqa MPHzCdZNSN0M3vYGggywH4rfdtgmpjEk8K/tgqz4l3mDWErTYk8WuIYcOT5pYxAAszvh 3enqGYB9//yomy1OYu8zFfgAEmCkYAXDH25S7aNcJQsS+i4XSGLWvWgiww515zHMGpxU mx833WldDgcPsR2YHTrMoSsic44R/YQSxzWM4SmkYWc1h4mpDD9wsYVY3wR7fZykRi7F ahnw== X-Gm-Message-State: AOJu0YxG1NL5Dv2bunV5vkIxyF5rS4Q97u/5ytAwO+HtxgO9HNBTy6Pd /qg/+GBh0hbrec/FhoneJ1DtLg== X-Google-Smtp-Source: AGHT+IFK1KnbI+fDlO1bdx6UP8yaAmZwtaIBWQk6k+LF293BjX1O1hwPlWnJlNqogIW9PFjCNL1pBA== X-Received: by 2002:a05:600c:285:b0:3fe:fe71:14dd with SMTP id 5-20020a05600c028500b003fefe7114ddmr7986775wmk.1.1692992259457; Fri, 25 Aug 2023 12:37:39 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id q14-20020a1cf30e000000b003fe1630a8f0sm6224396wmq.24.2023.08.25.12.37.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2023 12:37:39 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: 3d8ef251aa9d - main - lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code From: Jessica Clarke In-Reply-To: <202308251923.37PJN6EM082298@gitrepo.freebsd.org> Date: Fri, 25 Aug 2023 20:37:28 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <457A2B01-A4B0-4373-BD06-6BEBED922980@freebsd.org> References: <202308251923.37PJN6EM082298@gitrepo.freebsd.org> To: Robert Clausecker X-Mailer: Apple Mail (2.3731.600.7) X-Rspamd-Queue-Id: 4RXVbT0ympz3VT8 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 25 Aug 2023, at 20:23, Robert Clausecker wrote: >=20 > The branch main has been updated by fuz: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D3d8ef251aa9dceabd57f7821a0e6749d= 35317db3 >=20 > commit 3d8ef251aa9dceabd57f7821a0e6749d35317db3 > Author: Robert Clausecker > AuthorDate: 2023-08-25 16:22:22 +0000 > Commit: Robert Clausecker > CommitDate: 2023-08-25 19:21:54 +0000 >=20 > lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code >=20 > When the buffer is immediately preceeded by the character we > are looking for and begins with one higher than that character, > and the buffer is misaligned, a match was errorneously detected > in the first character. Fix this by changing the way we prevent > matches before the buffer from being detected: instead of > removing the corresponding bit from the 0x80..80 mask, set the > LSB of bytes before the buffer after xoring with the character we > look for. >=20 > The bug only affects amd64 with ARCHLEVEL=3Dscalar (cf. simd(7)). > The change comes at a 2% performance impact for short strings > if ARCHLEVEL is set to scalar. The default configuration is not > affected. That such bugs are being found in even the *scalar* code is concerning. How confident are we that all the various implementations have in fact been adequately tested if this slipped through? We have the 14 release coming up, and this makes me nervous about whether all this code is really ready for prime time yet. This seems like the kind of thing that needs a long time to bake in -CURRENT so that it can be used in anger and, hopefully, have all the edge cases hit. What have they been tested against, anyway? Can we borrow test suites from other projects? Jess