From patchwork Thu Jan 25 17:32:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 765962 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1007:b0:337:62d3:c6d5 with SMTP id a7csp74299wrx; Thu, 25 Jan 2024 09:33:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+RKtv31PSGy67WLRNPZ/C1VEr9RJW4bJz/9ueIKqR8IsQBNwZje2Z6jIJ5/T/rNAxgnAQ X-Received: by 2002:a05:620a:471e:b0:783:9642:d99c with SMTP id bs30-20020a05620a471e00b007839642d99cmr73617qkb.25.1706203999753; Thu, 25 Jan 2024 09:33:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706203999; cv=none; d=google.com; s=arc-20160816; b=FPlYH+lE/bumzwmrrpR74DQ0w1yADaKk0yZf8oIA/Po+lu5rL+s2hDiQAG6uKpQ3lO w5lFdxK5Oye7SmXch1n27YEDR2FKnn4mKhZ1pmUKKj98DoZ8ZMgcC/e+EsIJzxDWuH4T +4NjZtMPRqB1U2qiMj7WzTAH3phKbRqG0Vw8N2NyunTfBGlQBEEow0dyXzDd0kkbU4ct y2ekNWL2hWZNGgQXC/LlW9sufBNxkSFAhgOYRg/CaZxQAtJSBWRLy874QLSUoY9lPGPn oad591Ul+64cjpoejSJUznnYL6/uI6qRrLslR3aCqNf3ofroPrr50TDOUwg0NBH5OCD6 Ulgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Pwpt9wjrohdTqeijR7zcxx8QTW0iX7DDa8r/R2Jitvo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=OAejFx0gL5tSKn1jgyA37IrnIrzaG2mfv4K4+Iws1KpVEf1O7lgTzUjQd7PMwqN1jd MlPp8R6F62oeFKsQbgPfoN6Pr4ClllQpl0Tqqn2v7RC0Gdy3QXDuWOFGS5hoa7Cbdrlq WK+HJhDdKjAAE4a5wXF1V7An5UpsWXzJPujKXcnGXe5n0vhZx6Je3XAcvm4dlEgynuTb ctQw7QjAm9cRfgwLgJtIJy9BQslHXZxWgEn9NzxZ3cop7Jr13hjKaoW1+e6WyjpmGCdE cWMpWghaQPd1ezAK9+GKgQJ1OTbyA5eZyxsFf5A4sZG8chFozv4eHEIzmkntvhr2pak2 Rh7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ffEN8C6J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v15-20020a05620a0a8f00b0078337e502f8si13089043qkg.688.2024.01.25.09.33.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jan 2024 09:33:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ffEN8C6J; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT3aN-0006BK-0y; Thu, 25 Jan 2024 12:32:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rT3aL-0006Ah-2a for qemu-devel@nongnu.org; Thu, 25 Jan 2024 12:32:17 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rT3aJ-0006nf-30 for qemu-devel@nongnu.org; Thu, 25 Jan 2024 12:32:16 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e60e137aaso76632805e9.0 for ; Thu, 25 Jan 2024 09:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706203933; x=1706808733; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Pwpt9wjrohdTqeijR7zcxx8QTW0iX7DDa8r/R2Jitvo=; b=ffEN8C6J/0/GnUh6VwPq7UqAq1k2VMI5tGwNquDViq0GDBmNPZ85MIh1UJ4YrXhdBf pAFOtlDj4LAdXKrNF97Z/JHaydMsjFoYCzf6bZ9mIO+DPwKl4LAarebz52Q/Gf8bv4u8 3z9CnJg7ffEQDGvl1TX6cpW2lZmV7lQlL7diSfGqz+xv9m2ipiTFbg0hdbxnc7I5zMgw NchahjEkyVK99DTOI+mZZ1gk04IhSnSCypvrJDLnLGU8ctcaxv19lL7w6I/+ZFlbPk4j Q7RlH0BT5TzxnWE7WljXbHLWdk6OulF4dEnOiy4BIbuzMyPrawRL2Mqh+7aNHDAyfigp lC2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706203933; x=1706808733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pwpt9wjrohdTqeijR7zcxx8QTW0iX7DDa8r/R2Jitvo=; b=X2KXg4vNnxZfpgveiq6Ljen0MvMfP/mO7PGu+Glq8kJBzat4SfdyexaeGWXKD/Uh1P rrRyTfho3r9FTdl2F5+/T3N2hg7qfusSoOCXkMbIN2osVprGB1w5DrkNn6euozryB4Gq 9BM0fVxifcFBmYwBfrSerGP8tz8oUZ89D69MAdj9116pSawrcKNi1755TS4Uyp12EQep NrEur7RgsRclDbeKuAJwh3hY9pQNfb/6Z0Q++fzkdjDU7b7mz148+Nybv7d3qGvE58rs 7+31SsiOsj8VvEzGOqIDstmfDNwsQAUhP6zVPhamO1QYZ1wJ7PSG1T24C/Es4Ad9ovU2 uH0Q== X-Gm-Message-State: AOJu0YwZ7DubNjoCQRfUUno+Gmwnz51hU8cNZkrvcTZhMHwr7rHbweNI TIt6+tPWWZPihp852AsWE3ZszZ9GWDOP2OJcYUlcQe2Qze8OdhmhvQzogh3YeBU73ZSZ2w8u8tY b X-Received: by 2002:a05:600c:5756:b0:40e:c69d:94f3 with SMTP id jw22-20020a05600c575600b0040ec69d94f3mr51726wmb.185.1706203932991; Thu, 25 Jan 2024 09:32:12 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id i13-20020a05600c354d00b0040e45799541sm3287805wmq.15.2024.01.25.09.32.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 09:32:12 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 2/2] meson: Enable -Wvla Date: Thu, 25 Jan 2024 17:32:11 +0000 Message-Id: <20240125173211.1786196-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240125173211.1786196-1-peter.maydell@linaro.org> References: <20240125173211.1786196-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org QEMU has historically used variable length arrays only very rarely. Variable length arrays are a potential security issue where an on-stack dynamic allocation isn't correctly size-checked, especially when the size comes from the guest. (An example problem of this kind from the past is CVE-2021-3527). Forbidding them entirely is a defensive measure against further bugs of this kind. Enable -Wvla to prevent any new uses from sneaking into the codebase. Signed-off-by: Peter Maydell Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index d0329966f1b..385b8247073 100644 --- a/meson.build +++ b/meson.build @@ -601,6 +601,7 @@ warn_flags = [ '-Wno-psabi', '-Wno-gnu-variable-sized-type-not-at-end', '-Wshadow=local', + '-Wvla', ] if host_os != 'darwin'