From patchwork Wed Apr 5 13:48:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 79609 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp330951vqo; Wed, 5 Apr 2023 07:04:27 -0700 (PDT) X-Google-Smtp-Source: AKy350ZgmxfRGptxQYJkx1aHFUkJ9anR/WW9ZR2T0JIihCOiVl+Tuy5xiXXFZTZn7wqqjIwcq3e+ X-Received: by 2002:aa7:de8c:0:b0:4fa:785d:121 with SMTP id j12-20020aa7de8c000000b004fa785d0121mr1829665edv.16.1680703466903; Wed, 05 Apr 2023 07:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680703466; cv=none; d=google.com; s=arc-20160816; b=SE8bNMbyD68LKA/MEWWGL8m2nmnA6kQJuZ8M0WuqYKj4a/A4OBtBxrpiH+KZhfTurF fVIfBYO7pew3DKoaJFK+3ltmf+u5m2EDBs4HMRk8mdOycz29JFQtwFSPTIY3VO2A7bLo DqP3Nzj8830JATN18irtf8ELm9VSMoEzeFBUntgtKFsETGsGu6CwS+iOQSEcpK40VLN6 pWWjwD5H/L7GIHxqcafOwwGEmmF9HwdZdki5WLc0dhquiAqLP7a1VHlE155d0PE5Q76y 3WY/2rVkh5wJxhy11j5QShmuFdOlbdbmfKpwnc5V8BND11cl4fNVqRreVN495NGzBBZS 9CXQ== 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=QbEKCKgOR/RZd2XV2KUW0c6rjIuZaoZ0ZU7bYYsh3QU=; b=bIKbDLr6Reib7ZpnEbt303G/13ixRB8yeL5q7BL08XsZ1zOaH8HiBNgT8t/mwGOGdg IiKdFXdvF/7OGRAj5JnOsQDXqc6Q5yIWLg5VWMNuLEl87PGIu050r2X5eQk0im+wTWnE ncE/Kh+sK8UGa8dJuSWOBCxoHrNB8dh3/SpgUlSsY74eBjQC0Q/rg2FTvkkOnK3aXdgb YaG5vQYvHQZQNC820QuRRTdmmcjxYyLGSqFEkuhr55fsTBv79m72R6jyEjwcrfjCl8qD 8iwMyNdIGXHqvyPgobFyL5pzQ9/n7WHl/2jx21flQj+0Hxs9eNZ5s07RDep7yQ91P9aj ENpA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m22-20020a170906721600b008e6bdf85401si361516ejk.869.2023.04.05.07.03.52; Wed, 05 Apr 2023 07:04:26 -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 S238322AbjDEOCE (ORCPT + 99 others); Wed, 5 Apr 2023 10:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238241AbjDEOBO (ORCPT ); Wed, 5 Apr 2023 10:01:14 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A624ED0; Wed, 5 Apr 2023 07:00:58 -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 39717a673489e56e; Wed, 5 Apr 2023 16:00:56 +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 BD76D1B4EA62; Wed, 5 Apr 2023 16:00:55 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Bob Moore , Kees Cook Subject: [PATCH 20/32] ACPICA: struct acpi_resource_vendor: Replace 1-element array with flexible array Date: Wed, 05 Apr 2023 15:48:10 +0200 Message-ID: <1964259.yKVeVyVuyW@kreacher> In-Reply-To: <4845957.31r3eYUQgx@kreacher> References: <4845957.31r3eYUQgx@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 213.134.163.219 X-CLIENT-HOSTNAME: 213.134.163.219 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejuddgjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepledtieekkeekveeikeetgffgteeuteefjeevjeegudelvdduheeiuedvieehieevnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepvddufedrudefgedrudeifedrvdduleenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduieefrddvudelpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeegpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosggvrhhtrdhmohhorhgvsehinhhtvghlrdgtohhmpdhrtghpthhtohepkhgvvghssehouhht 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762345318340095186?= X-GMAIL-MSGID: =?utf-8?q?1762345318340095186?= From: Kees Cook ACPICA commit 446d05d5ea77946b8b3b8d0c638d1a446b18503e Similar to commit 7ba2f3d91a32 ("Replace one-element array with flexible-array"), replace the 1-element array with a proper flexible array member as defined by C99. 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). No binary changes appear in the .text nor .data sections. Link: https://github.com/acpica/acpica/commit/446d05d5 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- include/acpi/acrestyp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index f913983ef55e..77d735594ac2 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h @@ -194,7 +194,7 @@ struct acpi_resource_fixed_dma { struct acpi_resource_vendor { u16 byte_length; - u8 byte_data[1]; + u8 byte_data[]; }; /* Vendor resource with UUID info (introduced in ACPI 3.0) */ @@ -203,7 +203,7 @@ struct acpi_resource_vendor_typed { u16 byte_length; u8 uuid_subtype; u8 uuid[ACPI_UUID_LENGTH]; - u8 byte_data[1]; + u8 byte_data[]; }; struct acpi_resource_end_tag {