NetBSD Problem Report #55701

From jakllsch@kollasch.net  Wed Oct  7 18:46:09 2020
Return-Path: <jakllsch@kollasch.net>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D6A8B1A923A
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  7 Oct 2020 18:46:09 +0000 (UTC)
Message-Id: <20201007184603.GO21814@tazenda.kollasch.net>
Date: Wed, 7 Oct 2020 13:46:04 -0500
From: "Jonathan A. Kollasch" <jakllsch@kollasch.net>
Reply-To: jakllsch@kollasch.net
To: gnats-bugs@NetBSD.org
Subject: ecp_nistp521.c fails on Alpha

>Number:         55701
>Category:       lib
>Synopsis:       ecp_nistp521.c fails on Alpha
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 07 18:50:00 +0000 2020
>Last-Modified:  Sat Jul 08 23:55:03 +0000 2023
>Originator:     Jonathan A. Kollasch
>Release:        NetBSD 9.0
>Organization:
>Environment:
System: NetBSD toliman.kollasch.net 9.99.73 NetBSD 9.99.73 (GENERIC) #0: Tue Oct 6 16:39:23 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/alpha/compile/GENERIC alpha
Architecture: alpha
Machine: alpha
>Description:
src/crypto/external/bsd/openssl/dist/crypto/ec/ecp_nistp521.c does unaligned accesses
>How-To-Repeat:
start sshd, observe unaligned load/store warnings from kernel while it loads the ecdsa host key
>Fix:
define OPENSSL_NO_EC_NISTP_64_GCC_128 for Alpha

>Audit-Trail:
From: "Jonathan A. Kollasch" <jakllsch@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55701 CVS commit: src/crypto/external/bsd/openssl/include/openssl
Date: Thu, 8 Oct 2020 16:00:09 +0000

 Module Name:	src
 Committed By:	jakllsch
 Date:		Thu Oct  8 16:00:09 UTC 2020

 Modified Files:
 	src/crypto/external/bsd/openssl/include/openssl: opensslconf.h

 Log Message:
 openssl: Define OPENSSL_NO_EC_NISTP_64_GCC_128 for Alpha too

 The ecp_nistp521.c code depends on doing unaligned 64-bit accesses,
 which the NetBSD/alpha kernel doesn't like to trap and emulate.

 fixes PR lib/55701


 To generate a diff of this commit:
 cvs rdiff -u -r1.7 -r1.8 \
     src/crypto/external/bsd/openssl/include/openssl/opensslconf.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Rin Okuyama" <rin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55701 CVS commit: src/crypto/external/bsd/openssl.old/include/openssl
Date: Sat, 8 Jul 2023 23:42:49 +0000

 Module Name:	src
 Committed By:	rin
 Date:		Sat Jul  8 23:42:48 UTC 2023

 Modified Files:
 	src/crypto/external/bsd/openssl.old/include/openssl: opensslconf.h

 Log Message:
 openssl.old: Remove OPENSSL_NO_EC_NISTP_64_GCC_128 hack for alpha.

 Unaligned memory access reported in PR lib/55701 has been fixed by
 upstream commit:

 https://github.com/openssl/openssl/commit/77286fe3ec6b9777934e67e35f3b7007143b0734

 Actually, kernel no longer complains with machdep.unaligned_print=1,
 for sshd(8), ssh(1), and full ATF run.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1.1.1 -r1.2 \
     src/crypto/external/bsd/openssl.old/include/openssl/opensslconf.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Rin Okuyama" <rin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55701 CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64
Date: Sat, 8 Jul 2023 23:54:27 +0000

 Module Name:	src
 Committed By:	rin
 Date:		Sat Jul  8 23:54:27 UTC 2023

 Modified Files:
 	src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64: ec.inc

 Log Message:
 Sprinkle OPENSSL_NO_EC_NISTP_64_GCC_128 for aarch64eb.

 Otherwise, the following tests fail with wrong results:

 - crypto/libcrypto/t_ciphers:evp
 - crypto/libcrypto/t_pubkey:ec

 Official document says ec_nistp_64_gcc_128 does not support big endian:
 https://github.com/openssl/openssl/blob/master/INSTALL.md#enable-ec_nistp_64_gcc_128
 Thanks @a_rin for pointing this out on Twitter!

 Note that an equivalent hack was present in openssl.old for aarch64eb,
 alpha, and sparc64. But:

 - alpha received upstream fix (PR lib/55701)
 - sparc64 has been fixed differently (PR port-sparc64/57472)


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 \
     src/crypto/external/bsd/openssl/lib/libcrypto/arch/aarch64/ec.inc

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.