From nobody Tue Jan 31 01:51:51 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 4P5Shm1RC8z3c3tp; Tue, 31 Jan 2023 01:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P5Shm0w6cz3CqK; Tue, 31 Jan 2023 01:51:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675129912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nSC0OBsXX191X4E799eaAf3Dvc+Xx6WNzZ4N6INgwEk=; b=uQ8KX/cBmW++akouiNLm9cAoOhSrpLeInmTkFVdnWHujgPtwUnkYSGWmcJ6sIdAKuQtnIO HXpgw7gBEapgsqIQ0k9LsQ3CewqDPCxx6PfufnrPzWPJr34UnxpadEQ/doKFcQPtev0gMM ioMsNVSNVR1OKbiRS+1lCr/++BWgzn0Gtxwx7xZED5YGLXDtAUuYghD40jypkIiLQm4ckK vxpQCnlaw68P7UERs9RSmpaYKmIC+ryWRN3d9ce72k3m+yIXBEPWuKLA4OpGtTQOUb57ai FRqb1UlltNR5v4RrmFFhimIVqBPNJ4t512yLiXVSfTLUxzKzB70245QywWorcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675129912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nSC0OBsXX191X4E799eaAf3Dvc+Xx6WNzZ4N6INgwEk=; b=F25ufs5hkISIYlWWjrOQnJCyWCyv5kUF0wfh6r26gbYphAQXeKo70dJOtgPzg6C3+SDGfm PPq/al6QgFaPC0qWoJGrWgDSzJ5TX/wOo/46oMVNPgTBsMF/uQFWVvvkyf/ZJgg5XFU+oO jJ7tIgz4scYYRYsCjumuTAADjzxLYa9siK7HWIxJQJv9q2mHqC9Qactx/1H2QYr9B2ggD+ vcaval2CB/rfV49pDPU5UzvKpIeO8hjCYGj8kUUVDBwGgpGe9ASV9QseDcWy6KBxS48gRV sLGumTUBBoX7Ki9Mbc1xkHriyJV2MQgD42Th0ydNL2allYvdisZyTHUkwq+LQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675129912; a=rsa-sha256; cv=none; b=mbWdSySutAmgFCmpqo6xa4Az9ar/cvnBlpfES6ApoRzDstkSAZGqkknmYirTTC4jWQp27E eNHh1u3itLQNGfoOPhl7wMcoZx4S4yStXMD2zkiWjJPmunkJdKb5eyouIn2vif5t728qxY 3jjHkXWTRl8B8YISHq256M2HcRKm7UMT/yyvMtdAEzXFlUyYbtKFe4MoMCvMSUlVWoeHhr Eo95AUOBHmrREpRBuqbR069BMKzUcuiAPq19I4X5OUTiGAyZfL2Y8Q29kyEZZX2DZO/Rnp pBxn0tw/nzJOVd0cjQOwXsehTfaQzhfagFmP1CH/8PlqvlYduZpcYNt+IsRNYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P5Shl75kDzWtT; Tue, 31 Jan 2023 01:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30V1ppCY069440; Tue, 31 Jan 2023 01:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30V1ppvu069439; Tue, 31 Jan 2023 01:51:51 GMT (envelope-from git) Date: Tue, 31 Jan 2023 01:51:51 GMT Message-Id: <202301310151.30V1ppvu069439@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 2b7b51c479c4 - stable/13 - libcrypto: Work around strict aliasing violations in bn_nist.c 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b7b51c479c44e60b37821783487bfc5dc0471f4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=2b7b51c479c44e60b37821783487bfc5dc0471f4 commit 2b7b51c479c44e60b37821783487bfc5dc0471f4 Author: Jessica Clarke AuthorDate: 2022-07-25 17:17:50 +0000 Commit: Jessica Clarke CommitDate: 2023-01-31 01:50:27 +0000 libcrypto: Work around strict aliasing violations in bn_nist.c This file is full of strict aliasing violations. Previously it was only optimised in ways that broke the code by CHERI LLVM, but now it appears that the in-tree LLVM also breaks it for RISC-V, resulting in broken ECDSA signature validation with error messages like the following: root@unmatched:/usr/src # ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ecdsa_key is not a key file. root@unmatched:/usr/src # git fetch fatal: unable to access 'https://git.FreeBSD.org/src.git/': error:1012606B:elliptic curve routines:EC_POINT_set_affine_coordinates:point is not on curve Reviewed by: dim, jkim Obtained from: CheriBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35885 (cherry picked from commit 3b41ae32124ad7b61b2297b2e7f3aa5d76b30c53) --- secure/lib/libcrypto/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index 8a38f0f563a0..d8b8f454122c 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -122,6 +122,11 @@ SRCS+= ppc.S ppc-mont.S SRCS+= bn_asm.c .endif +# Full of strict aliasing violations that LLVM has been seen to break with +# optimisations, which can lead to ECDSA signatures not working. See +# https://github.com/openssl/openssl/issues/12247 for the upstream bug report. +CFLAGS.bn_nist.c+= -fno-strict-aliasing + # buffer SRCS+= buf_err.c buffer.c