From nobody Mon Jul 25 17:20:44 2022 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 4Ls6JD28pvz43HBl; Mon, 25 Jul 2022 17:20:44 +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 4Ls6JD1jsgz3XpQ; Mon, 25 Jul 2022 17:20:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658769644; 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=IeVtzHQt/lbbiXykVmNHSSIxL5R/TrvFYjc97t/ntnM=; b=SMZv4bQ2p707sqf9zEroftXHzzSoKnYM6N5QT3HS+czb98MHOc378Ys9lKCUHhNz7ctoTD v9wvOKZ80R+4msPnF7EXljfkGXx1GWtBkFWv29cG6RQiMYO73o8GH2WTgjvXSRJC2vCoS7 ZVmpd1Gvyfz2iZDJzGvJHEsPpMQoUrovsjjYoNQvLl22hEkT7TFVh3GRw2kvTBsvhHke5r QWoetO2fv1w9qqKKPc99ok3OTpGsYqklWO4BCUyxc8trCWMITV7TBS1vM1FSWbzuQlUPUw tz963qr9aVGr+YIMBC59/0cyvKVh1Xrjmh201qagaM3uRGwOBJcY8+ytvVfjYA== 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 4Ls6JD0mQPz1502; Mon, 25 Jul 2022 17:20:44 +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 26PHKiuB001047; Mon, 25 Jul 2022 17:20:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26PHKiWT001046; Mon, 25 Jul 2022 17:20:44 GMT (envelope-from git) Date: Mon, 25 Jul 2022 17:20:44 GMT Message-Id: <202207251720.26PHKiWT001046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 3b41ae32124a - main - 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/main X-Git-Reftype: branch X-Git-Commit: 3b41ae32124ad7b61b2297b2e7f3aa5d76b30c53 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658769644; 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=IeVtzHQt/lbbiXykVmNHSSIxL5R/TrvFYjc97t/ntnM=; b=pOdXzpMWmxgLJ8kqANB8ioMSxUxMzthl1JVfEaWzmSgaafqj3zB2/GxRPWIfaVsrmvyO3c stb8F0I6gqFcdAAUnbVRNXbFLoXwTkmJUlaG50Zk2QwnNsil/sT104bmCwBvEDIGJlBbIL mR1Xn1aXtiaALDS/uio/v+Kc8GVjsWNfxY4ppsNNz3JR1AD75iiZqT0pRHrfiwyqzDNS6I zBFmYyivrpF6DKFxXuyyKMuq6/TPYrLOGG5WAIAVWwWZCWyhlhKYh9IUe12FmL57/xQKzj CXKcQ3/ygbrs/y+Ta3N9bJsmThUXXa+ABBeTyMvJ/qO6DA9p6dQWgSv//2uDwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658769644; a=rsa-sha256; cv=none; b=IPBNSRiaZjBW5EwFUyFH+51AaxvYvC8fVkOYR92HHdBiXYDzXHS2X5jEeviYzO41u4+per rA9k/W3GNAkvzHdkzdfe3W7iwpDI8eb6WjUPHZJeOx1GvgkwXa51RZVeS3ReOfvFK5XSG3 5amNc72xyClGLkZmT81730qiZiEjJzab47994N9ElzRB8o8amxTqzLtpmUBWbsHrbKQV0F xAmyBl+74E5AMBmDtsgR95wfIz3IIxggQYVOZKFpscenpDnB60bwl26wRRqhYXmR2S1MFS pngamEia4HCKSEqHSPaOUHIsWygOxdRBAhpQ0/RpnshsS8Onmt8xgExTMjnA2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=3b41ae32124ad7b61b2297b2e7f3aa5d76b30c53 commit 3b41ae32124ad7b61b2297b2e7f3aa5d76b30c53 Author: Jessica Clarke AuthorDate: 2022-07-25 17:17:50 +0000 Commit: Jessica Clarke CommitDate: 2022-07-25 17:17:50 +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 --- secure/lib/libcrypto/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index cf9259a19e16..e318179120ce 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -121,6 +121,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