From nobody Fri May 3 18:58:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1614585460; cv=none; d=zohomail.com; s=zohoarc; b=iVvpapLMJjnITWmVO5W8SQSYLGApHHlADi2rLvgT0lNZ10OBaVeWK6Q+pGbf6Mnsp+StlO/RLouLAhPQEl+NSTnbTQLnYTlhaLWyF6TgBN5DHGBchlYQO7KSavBZwj0gTplXVCfMQKHls/Ej97hzCPc1LDOzaKx0gMMb2Z8fPqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614585460; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Bm618ENHOLlPwZbs+NnfWMXdyQyfD9kLXr1Ug/4Lg1k=; b=FdMT7brX5xQdEa34KgqCSmooU5VPk16td3HP/ddZ+9aJMABP8qPKULmhe8ihWpQ9Yv7pJY2jqjKTlnAnN6PyLYMYG0EcL/QHXIVqzSyXFd1jiIRVd54lkFosBRISjoTdYJgdnAvHgBusiTpBXkSlJNb7ql/5mP2S6rG+AoB0FAw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1614585459983446.14603941070084; Sun, 28 Feb 2021 23:57:39 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.91307.172550 (Exim 4.92) (envelope-from ) id 1lGdQe-0005Bo-9u; Mon, 01 Mar 2021 07:57:20 +0000 Received: by outflank-mailman (output) from mailman id 91307.172550; Mon, 01 Mar 2021 07:57:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lGdQe-0005Bh-6p; Mon, 01 Mar 2021 07:57:20 +0000 Received: by outflank-mailman (input) for mailman id 91307; Mon, 01 Mar 2021 07:57:18 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lGdQc-0005Bc-Bt for xen-devel@lists.xenproject.org; Mon, 01 Mar 2021 07:57:18 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f5c1ae32-e259-421f-8712-e8c3d8f3f140; Mon, 01 Mar 2021 07:57:16 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C8DBFAAC5; Mon, 1 Mar 2021 07:57:15 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f5c1ae32-e259-421f-8712-e8c3d8f3f140 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1614585435; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bm618ENHOLlPwZbs+NnfWMXdyQyfD9kLXr1Ug/4Lg1k=; b=JCakssBrBePqAAzizP9LOlOF43sKGgMfHEd0ChrLAksTVJPRuyKQ7SVk86rlQ9Uei15JCh iohchgdET0NjgqExnHkZPZiyYnRnyCYyZ7gMUkBTSJvtw50tsGlObo+sb2E54L8rS+Yn60 5X88fiA7yNHfbQajWm/cwza9u3jyec8= To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu From: Jan Beulich Subject: [PATCH][4.15] crypto: adjust rijndaelEncrypt() prototype for gcc11 Message-ID: <05fe3295-7993-2eb5-37bc-a6d04fde1fbc@suse.com> Date: Mon, 1 Mar 2021 08:57:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" The upcoming release complains, not entirely unreasonably: In file included from rijndael.c:33: .../xen/include/crypto/rijndael.h:55:53: note: previously declared as 'cons= t unsigned char[]' 55 | void rijndaelEncrypt(const unsigned int [], int, const unsigned = char [], | ^~~~~~~~~~~~~~~= ~~~~~~~ rijndael.c:865:8: error: argument 4 of type 'u8[16]' {aka 'unsigned char[16= ]'} with mismatched bound [-Werror=3Darray-parameter=3D] 865 | u8 ct[16]) | ~~~^~~~~~ In file included from rijndael.c:33: .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsi= gned char[]' 56 | unsigned char []); | ^~~~~~~~~~~~~~~~ While it's not really clear to me why it would complain only for arg 4, the adjustment to make is obvious and riskfree also for arg 3: Simply declare the correct array dimension right away. This then allows compilers to apply checking at call sites, which seems desirable anyway. For the moment I'm leaving untouched the disagreement between u8/u32 used in the function definition and unsigned {char,int} used in the declaration, as making this consistent would call for touching further functions. Reported-by: Charles Arnold Signed-off-by: Jan Beulich Reviewed-by: Julien Grall --- There are quite a few more issues with gcc11, but from my brief initial inspection I'm suspecting (hoping) it'll rather be the compiler which will get further changed by the time their release gets finalized. Just one example: .../xen/include/xen/string.h:101:27: error: '__builtin_memcmp' specified bo= und 4 exceeds source size 0 [-Werror=3Dstringop-overread] 101 | #define memcmp(s1, s2, n) __builtin_memcmp(s1, s2, n) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ mpparse.c:722:13: note: in expansion of macro 'memcmp' 722 | if (memcmp(mpf->mpf_signature, "_MP_", 4) =3D=3D 0 && | ^~~~~~ Clearly neither the 1st nor the 2nd argument have a "source size" of 0. --- a/xen/include/crypto/rijndael.h +++ b/xen/include/crypto/rijndael.h @@ -52,7 +52,7 @@ =20 int rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int); int rijndaelKeySetupDec(unsigned int [], const unsigned char [], int); -void rijndaelEncrypt(const unsigned int [], int, const unsigned char [], - unsigned char []); +void rijndaelEncrypt(const unsigned int [], int, const unsigned char [16], + unsigned char [16]); =20 #endif /* __RIJNDAEL_H */