From nobody Fri Aug 25 19:37:28 2023 X-Original-To: dev-commits-src-main@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 4RXVbT3HCnz4qjJM for ; Fri, 25 Aug 2023 19:37:41 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 4RXVbT1WsYz3VWF 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-f47.google.com with SMTP id 5b1f17b1804b1-401b3ea0656so11256235e9.0 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=XDOVSbtY9x3Cje29Vz1Rl0Wx8Q9zOOtZ9Pl7rDI8DWoIdYXBRrBpL4OwRx1QY2Pf44 zeM+G/35EkpMkSFHX1hQQbfizjmrFsUTHF0l7qMU//hQM8xWCUMweVvA1mx6coZOTq13 jgznyb0M0nl6rQcQAYMmNiJZrR1j7DNQoOiiTSI97BG7ex6CvF3POcnVn8594EjpR28d gsRVxZXzqFFftzgN9xmcnkJc2DSZmwWTTSHfOG6xzUvLfNmQz8snpLTGQskQCRjcurIH FaPYZhAjkonpv04AHSTKFeRRuVTM8/NePxIumyfsI9L41kNA5p80U+yax/MsczM0s9mu X3Cw== X-Gm-Message-State: AOJu0Yztuy17zsEFmGv/GGICzGvd/CNBYOtjI7E6DEgDJEPtir6IC2Jj dpLo4G5ElinAhFuWgbkFDgAN8nuSkC9ZKUqgNXk8Rg== 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 4RXVbT1WsYz3VWF 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