From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PULL_REQUEST,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32FDFC07E95 for ; Tue, 13 Jul 2021 15:47:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B06360698 for ; Tue, 13 Jul 2021 15:47:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B06360698 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3KdY-0006Ur-OS for qemu-devel@archiver.kernel.org; Tue, 13 Jul 2021 11:47:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Kbi-0004Qu-UD for qemu-devel@nongnu.org; Tue, 13 Jul 2021 11:46:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Kbg-0000ip-O2 for qemu-devel@nongnu.org; Tue, 13 Jul 2021 11:46:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626191159; h=from:from:reply-to: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: in-reply-to:in-reply-to:references:references; bh=Eo5ljEbv2uasnZZEBtSf/t/b0RciXw3Vuwvsze86q/s=; b=Qq3XekGtuRoCO83bKF5dAm4aazeEj47DUKVDaSVm7qCNz6vbRfmqDowTXDjFsd+ob6GP+0 L7uwM4xNqq24m3W0KJgUKfMOttr5Yo70yIfy7G9GBJ/9ElQxkZvrBCbo5fa8OHzZMPNbtM HaCtDsvbTsc+JSq6awTzO+HefyXGqOo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-417--GmYEy9PN9KzHBvgqZRYUA-1; Tue, 13 Jul 2021 11:45:55 -0400 X-MC-Unique: -GmYEy9PN9KzHBvgqZRYUA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F0BB5101F002; Tue, 13 Jul 2021 15:45:53 +0000 (UTC) Received: from redhat.com (ovpn-113-1.ams2.redhat.com [10.36.113.1]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 821CC19C44; Tue, 13 Jul 2021 15:45:42 +0000 (UTC) Date: Tue, 13 Jul 2021 16:45:39 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= To: Peter Maydell , Eduardo Otubo , Jiri Pirko , Juan Quintela , Jason Wang , Markus Armbruster , QEMU Developers , Gerd Hoffmann , Eric Blake , "Dr. David Alan Gilbert" Subject: Re: [PULL 00/22] Crypto and more patches Message-ID: References: <20210712130223.1825930-1-berrange@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=berrange@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, WEIRD_PORT=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Jul 13, 2021 at 02:45:28PM +0100, Daniel P. Berrangé wrote: > On Tue, Jul 13, 2021 at 10:25:44AM +0100, Peter Maydell wrote: > > On Mon, 12 Jul 2021 at 14:23, Daniel P. Berrangé wrote: > > > > > > The following changes since commit bd38ae26cea0d1d6a97f930248df149204c210a2: > > > > > > Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210710' into staging (2021-07-12 11:02:39 +0100) > > > > > > are available in the Git repository at: > > > > > > https://gitlab.com/berrange/qemu tags/crypto-and-more-pull-request > > > > > > for you to fetch changes up to 1fc9958410c8683950ea22084b133a755561398b: > > > > > > tests/migration: fix unix socket migration (2021-07-12 14:00:20 +0100) > > > > > > ---------------------------------------------------------------- > > > Merge crypto updates and misc fixes > > > > > > * Introduce a GNUTLS backend for crypto algorithms > > > * Change crypto library preference gnutls > gcrypt > nettle > built-in > > > * Remove built-in DES impl > > > * Remove XTS mode from built-in AES impl > > > * Fix seccomp rules to allow resource info getters > > > * Fix migration performance test > > > * Use GDateTime in io/ and net/rocker/ code > > > > > > ---------------------------------------------------------------- > > > > Hi; this failed 'make check' on ppc64be: > > > The failure is reproducible. Here's a backtrace from a debug > > build: > > > > test-crypto-cipher: cbc.c:53: nettle_cbc_encrypt: Assertion `!(length > > % block_size)' failed. > > > > Thread 1 "test-crypto-cip" received signal SIGABRT, Aborted. > > 0x00007ffff77b8460 in __libc_signal_restore_set (set=0x7fffffffe468) > > at ../sysdeps/unix/sysv/linux/internal-signals.h:86 > > 86 ../sysdeps/unix/sysv/linux/internal-signals.h: No such file or > > directory. > > (gdb) bt > > #0 0x00007ffff77b8460 in __libc_signal_restore_set > > (set=0x7fffffffe468) at > > ../sysdeps/unix/sysv/linux/internal-signals.h:86 > > #1 __GI_raise (sig=) at ../sysdeps/unix/sysv/linux/raise.c:48 > > #2 0x00007ffff779bd40 in __GI_abort () at abort.c:79 > > #3 0x00007ffff77ae490 in __assert_fail_base (fmt=, > > assertion=assertion@entry=0x7ffff72b6f38 "!(length % block_size)", > > file=file@entry=0x7ffff72b6f30 "cbc.c", line=line@entry=53, > > function=function@entry=0x7ffff72b6f50 "nettle_cbc_encrypt") at assert.c:92 > > #4 0x00007ffff77ae528 in __GI___assert_fail (assertion=0x7ffff72b6f38 > > "!(length % block_size)", file=0x7ffff72b6f30 "cbc.c", > > line=, function=0x7ffff72b6f50 > > "nettle_cbc_encrypt") at assert.c:101 > > #5 0x00007ffff728c154 in nettle_cbc_encrypt () from > > /usr/lib/powerpc64-linux-gnu/libnettle.so.8 > > #6 0x00007ffff7e6b894 in ?? () from > > /usr/lib/powerpc64-linux-gnu/libgnutls.so.30 > > #7 0x00007ffff7e6c72c in ?? () from > > /usr/lib/powerpc64-linux-gnu/libgnutls.so.30 > > #8 0x00007ffff7d6d794 in gnutls_cipher_encrypt2 () from > > /usr/lib/powerpc64-linux-gnu/libgnutls.so.30 > > #9 0x000000010003c330 in qcrypto_gnutls_cipher_encrypt > > (cipher=0x10016e550, in=0x7fffffffeca8, out=0x7fffffffecc8, len=32, > > errp=0x100122b48 ) at ../../crypto/cipher-gnutls.c.inc:103 > > #10 0x000000010003cef0 in qcrypto_cipher_encrypt (cipher=0x10016e550, > > in=0x7fffffffeca8, out=0x7fffffffecc8, len=32, > > errp=0x100122b48 ) at ../../crypto/cipher.c:177 > > #11 0x000000010002e75c in test_cipher_null_iv () at > > ../../tests/unit/test-crypto-cipher.c:749 > > #12 0x00007ffff7bbed38 in ?? () from > > /usr/lib/powerpc64-linux-gnu/libglib-2.0.so.0 > > #13 0x00007ffff7bbeabc in ?? () from > > /usr/lib/powerpc64-linux-gnu/libglib-2.0.so.0 > > #14 0x00007ffff7bbeabc in ?? () from > > /usr/lib/powerpc64-linux-gnu/libglib-2.0.so.0 > > #15 0x00007ffff7bbf364 in g_test_run_suite () from > > /usr/lib/powerpc64-linux-gnu/libglib-2.0.so.0 > > #16 0x00007ffff7bbf3bc in g_test_run () from > > /usr/lib/powerpc64-linux-gnu/libglib-2.0.so.0 > > #17 0x000000010002eb78 in main (argc=1, argv=0x7ffffffff8e8) at > > ../../tests/unit/test-crypto-cipher.c:821 > > > > In frame 9 len is 32 and ctx_>blocksize is 16, so ¯\_(ツ)_/¯ > > The len in frame 9 is the plain text len, but I think the assert is > complaining about the initialization vector len, which is likely > zero here. I think I know what to fix, but I'm surprised this would > be architecture specific though. Turns out it is related to whether gnutls has hardware acceleration for CBC mode for a given arch. After compiling gnutls without acceleration for x86_64, I could reproduce it and figure out a fix. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|