Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp730503rwl; Wed, 5 Apr 2023 07:04:19 -0700 (PDT) X-Google-Smtp-Source: AKy350YuEOQnClZG2T85ELxaiFu+aYE41h7Q91eRwDh+RNPvZElSGiPGnjPI2UDwUOs5CmbIFn7E X-Received: by 2002:a17:906:3454:b0:933:89a1:57e6 with SMTP id d20-20020a170906345400b0093389a157e6mr3048952ejb.26.1680703459282; Wed, 05 Apr 2023 07:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680703459; cv=none; d=google.com; s=arc-20160816; b=uREeE6srrvVrXndJddiO3JaXtCkhujyjaWgJjMZYFr0YqMK6gwyIJbOsC5bnBy0apW XMdym3IzBLEZgRCCql0OHHfeVfT7Qc6QiECciEFNG5n2o651SGqswZ5QZ1mszYovj7IW JCSYwQOXzzPveIJrnNQ4b4fybv9jopIBBe168iC5KyQK4UoR/tTNN+hiZM4O16g/BCzH XOnpnNx7ZsC1tHf0io5QT2XYmcnJRUpZJ8q5mWCG/CoMLartcQ7GnOoNt/gEQNxca9jZ xWQgCfvoWASAKg5nwMId+vy87Q2IoQ93o7qMelQJPxu1Wr2LuOfx4oXNpTV6dkoDLexz 94xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=HN56+93jFXQkpc6gcQGmVk3yulxcx4JRx4yjtU47PXc=; b=RG2HowwYXFYXKL6Z+LrTIDSKpg7jOc6vPwA8B8kkGLcKVQi4atFdIfCq0VlJihAkjM UwlNZy3YV2ckxrpMNRa844uUS1gxi9wf2hiOOUFzY237nAitxntJdL+xKbd16RqieEqf 2fMtFNWjQ5SO+jMMqdpNQz9/fZEeRM/O/CgjYBSUNt27VtOXi23J1A2Rk4keg5QN9VJw pzt+w/1rfqjoSA6Xi2NfyEasWkBYMfkf/74YlIe1GPpM+qm1S3gmF9gylg7lBJYD4CNs PM7WrT+ge4g90WPSSH8NUa09enWOY1wtrzd6B8nN5J9UI83m2ZOwL0Jic12cY2RAarwd +fHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a17090637ce00b0093defbd6281si9771011ejc.1032.2023.04.05.07.03.52; Wed, 05 Apr 2023 07:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238220AbjDEOBJ (ORCPT + 99 others); Wed, 5 Apr 2023 10:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238212AbjDEOA4 (ORCPT ); Wed, 5 Apr 2023 10:00:56 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D38336198; Wed, 5 Apr 2023 07:00:49 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.1.0) id 61b86c548d00002b; Wed, 5 Apr 2023 16:00:48 +0200 Received: from kreacher.localnet (unknown [213.134.163.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 3CDD61B4EA5B; Wed, 5 Apr 2023 16:00:47 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Bob Moore , Kees Cook Subject: [PATCH 25/32] ACPICA: struct acpi_resource_dma: Replace 1-element array with flexible array Date: Wed, 05 Apr 2023 15:53:20 +0200 Message-ID: <4524051.cEBGB3zze1@kreacher> In-Reply-To: <4845957.31r3eYUQgx@kreacher> References: <4845957.31r3eYUQgx@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.163.219 X-CLIENT-HOSTNAME: 213.134.163.219 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejuddgjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepledtieekkeekveeikeetgffgteeuteefjeevjeegudelvdduheeiuedvieehieevnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepvddufedrudefgedrudeifedrvdduleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduieefrddvudelpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeegpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosggvrhhtrdhmohhorhgvsehinhhtvghlrdgtohhmpdhrtghpthhtohepkhgvvghssehouhht fhhluhigrdhnvght X-DCC--Metrics: v370.home.net.pl 1024; Body=4 Fuz1=4 Fuz2=4 X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook ACPICA commit 8409bb869a1790f6e02391c3f0eaf9c5fa63e33f Similar to "Replace one-element array with flexible-array", replace the 1-element array with a proper flexible array member as defined by C99, but without changing the structure size. This allows the code to operate without tripping compile-time and run- time bounds checkers (e.g. via __builtin_object_size(), -fsanitize=bounds, and/or -fstrict-flex-arrays=3). As with IRQs, leave a single element in a union. No binary changes appear in the .text nor .data sections. Link: https://github.com/acpica/acpica/commit/8409bb86 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- include/acpi/acrestyp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index 77d735594ac2..52e82d65016b 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h @@ -150,7 +150,10 @@ struct acpi_resource_dma { u8 bus_master; u8 transfer; u8 channel_count; - u8 channels[1]; + union { + u8 channel; + ACPI_FLEX_ARRAY(u8, channels); + }; }; struct acpi_resource_start_dependent { -- 2.35.3