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=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 4E917C433E0 for ; Mon, 1 Mar 2021 07:57:34 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 ED94A64DBD for ; Mon, 1 Mar 2021 07:57:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED94A64DBD Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 'const 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=array-parameter=] 865 | u8 ct[16]) | ~~~^~~~~~ In file included from rijndael.c:33: .../xen/include/crypto/rijndael.h:56:13: note: previously declared as 'unsigned 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 --- 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 bound 4 exceeds source size 0 [-Werror=stringop-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) == 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 @@ 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]); #endif /* __RIJNDAEL_H */