From patchwork Wed May 5 21:10:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12241071 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 12A28C433ED for ; Wed, 5 May 2021 21:25:59 +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 A1399613EB for ; Wed, 5 May 2021 21:25:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1399613EB 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]:57032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leP1p-0000uv-PD for qemu-devel@archiver.kernel.org; Wed, 05 May 2021 17:25:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leOpE-0001wZ-Di for qemu-devel@nongnu.org; Wed, 05 May 2021 17:12:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leOp6-00058T-97 for qemu-devel@nongnu.org; Wed, 05 May 2021 17:12:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620249167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BNIGbNGB2kAXmzDhqFSxh3VfwsIC++UOzvIwklsGj4s=; b=Fk5Bwwx9aQ1pXtVS1K/0zc1ZW5lKNzYh8j+TZNxzPyFUSDN99YFL3l+OadNJza+LZ74UNO IpDa43WuDlZPIncs0aN6dtrYdKy59w7OmdCD9bwfq+ozxHOq7ZEOMijWJ1ZJtVkLMh3xPk zbJNYrXmvOte83j/37Gwa9IPrzi5gG8= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-261-mxZlCHDoMZWxZBLe1GkIHQ-1; Wed, 05 May 2021 17:12:46 -0400 X-MC-Unique: mxZlCHDoMZWxZBLe1GkIHQ-1 Received: by mail-wr1-f72.google.com with SMTP id 4-20020adf91840000b029010d9c088599so1216572wri.10 for ; Wed, 05 May 2021 14:12:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BNIGbNGB2kAXmzDhqFSxh3VfwsIC++UOzvIwklsGj4s=; b=o7K29iZQpq9/yxJBTRv2GLpf2PSuOkjNoJm1FimcixBe8PgL1DFDpSidIkubwEAwy/ 9M3zdiJflJx3gGiU+UoaFggUyJbYP5Yyispo48GsRL3rQgrnG3sJxHfQYEMLrT8Qet3/ 0HnboRD6ePoRLMe7R7IEieCXNqrqG3e07egRJfadSjnbNeJb1N1WwFtQptAANXsdhREq CN4HGV7j9TtdkA3w5iqLvFs/k13sBSjQt2KGsQzHYvE31TItPbcHfQl4S6Li1hKybkVJ o9OzmmxST/uuXN5qzUgRXPevhJV05iMGsYiwxmF4ch6ryhT5lqE3QfkrlcD9tfLt/Tqj 6VuQ== X-Gm-Message-State: AOAM530fxjw6PifGPqdowxMt1yR8tB7Bm0Etd1AXW5eZ6Trj06+xsDzZ UlIFyIiI+goJfdUIW6Lfd7LqUiAblnyyDtAcX1b7ePA5Yz8w+KzD8VicSzsWBBYa3mFPf2/hmT7 CtMnMzrCiYfH3S71zp4HJ5afeWRKdQchHIUSWxGeYETuMiJAlzQ1+7RRr6N64q/RO X-Received: by 2002:adf:cc85:: with SMTP id p5mr1048090wrj.75.1620249164963; Wed, 05 May 2021 14:12:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSKnbW9quRN+wUvUODkYnuSjkpq3sgG+NpbBMsKxtmu82GgOeCRXqipeTdWbz31k5j5lvi5Q== X-Received: by 2002:adf:cc85:: with SMTP id p5mr1048067wrj.75.1620249164748; Wed, 05 May 2021 14:12:44 -0700 (PDT) Received: from x1w.redhat.com (astrasbourg-653-1-188-220.w90-13.abo.wanadoo.fr. [90.13.127.220]) by smtp.gmail.com with ESMTPSA id n10sm665996wrw.37.2021.05.05.14.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 14:12:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 23/23] configure: Prohibit variable-length allocations by using -Wvla CPPFLAG Date: Wed, 5 May 2021 23:10:47 +0200 Message-Id: <20210505211047.1496765-24-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210505211047.1496765-1-philmd@redhat.com> References: <20210505211047.1496765-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@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.693, 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 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: , Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Gerd Hoffmann , =?utf-8?q?Marc-Andr?= =?utf-8?q?=C3=A9_Lureau?= , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Now that we converted all variable-length allocations in the repository, add the -Wvla CPPFLAG to trigger a build failure if such allocation is used. This should help avoiding vulnerabilities such CVE-2021-3527 (see commit range 3f67e2e7f13..05a40b172e4). Inspired-by: Gerd Hoffmann Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 4f374b48890..a78ff15b52f 100755 --- a/configure +++ b/configure @@ -552,7 +552,7 @@ ARFLAGS="${ARFLAGS-rv}" # provides these semantics.) QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" QEMU_CFLAGS="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" -QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" +QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls -Wvla $QEMU_CFLAGS" QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" # Flags that are needed during configure but later taken care of by Meson