From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEB66C636CC for ; Wed, 1 Feb 2023 02:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=eZDOZG22g4KbvtmMY8Ngy2x+SfmAYb55h7KvB/48gUs=; b=aJr F/qSZGquSvZ3Hbgn6lx/AijQcmSfC5e2vQun7uyikstoU8tvfr5wGiyNQaFKvjAjFyvGfOkgiG5y8 0wX9zA20TXKncxKralYIoRlYc1Ya/JJS12KSKrsm2EmN/SLDngDb8mf2PO1UcRWVJ6a2waFz5gJUo RwcM0duDXxdJFh5D2cu9xzFw9U/ys3GSDNpJrc0Lm282r57vFzgLmHSimN7ZRmIurzSEHNo2T7Yq6 pSrgiO+6iv12cv9X0/BdkeOYD7+zPUiExhIb4yzW2nckjQY/3evJXMrA7/g9ci2nAdKigJrEJ353z DlGZ5LPBzd5Vhzqrm4/T6ChyBGFuHnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN2bt-009v1Z-0H; Wed, 01 Feb 2023 02:12:29 +0000 Received: from air.basealt.ru ([194.107.17.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pN2bo-009uvp-F2 for linux-arm-kernel@lists.infradead.org; Wed, 01 Feb 2023 02:12:26 +0000 Received: by air.basealt.ru (Postfix, from userid 490) id CFC962F20227; Wed, 1 Feb 2023 02:12:17 +0000 (UTC) Received: from localhost (broadband-188-32-10-232.ip.moscow.rt.ru [188.32.10.232]) by air.basealt.ru (Postfix) with ESMTPSA id 331322F2022B; Wed, 1 Feb 2023 02:12:16 +0000 (UTC) Date: Wed, 1 Feb 2023 05:12:13 +0300 From: "Alexey V. Vissarionov" To: Lorenzo Pieralisi Cc: Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lvc-project@linuxtesting.org, gremlin@altlinux.org Subject: [PATCH] ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node) Message-ID: <20230201021213.GC446@altlinux.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230131_181224_709143_62F3A1AC X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1695268774348691822==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1695268774348691822== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The node is a pointer to struct acpi_iort_node, so it's just 4 or 8 bytes, while the structure itself is several times bigger. Found by ALT Linux Team (altlinux.org) and Linux Verification Center (linuxtesting.org) using SVACE. Signed-off-by: Alexey V. Vissarionov Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG") --- diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 38fb84974f352cc8..edb94b52bf3a21ce 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -1832,7 +1832,8 @@ static int __init iort_add_platform_device(struct acp= i_iort_node *node, if (ops->dev_add_platdata) ret =3D ops->dev_add_platdata(pdev); else - ret =3D platform_device_add_data(pdev, &node, sizeof(node)); + ret =3D platform_device_add_data(pdev, &node, + sizeof(struct acpi_iort_node)); =20 if (ret) goto dev_put; --=20 Alexey V. Vissarionov gremlin =F0=F2=E9 altlinux =F4=FE=EB org; +vii-cmiii-ccxxix-lxxix-xlii GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net --IJpNTDwzlM2Ie8A6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJj2cp9AAoJEFv2F9znRj5KqrIP/0Hemgf7fBCwiUf7whyI7mbB sNZXvAbeawNfI5PIDo2h0hEQvzv/KQqn2sGCOcDkotmUTOgyJJGHxI8vJS0behVF uVqKMxIVNqtEBabOCqMF+cIpYZxW3UWBHm7WIRIycAebTpCh0ORgodVdAbyQjFJo VDHkVAFfzhfGtocUKWw1w910AfTb1/xvQ6AkoHZHCRvx3rz+m0u2JiK9xgXFIKWN Guemhvc6cH8q10LQto5giQ9LkhLLLOMqze3sVBvHYOm3aM7FXaB0xRz435QVa3BO f1OiPaPQzOXa/6Q4lqR0jEI2ZLuI0sY17O9CpZJof5XXtNmMNudU+GkyfYEBSRO5 VchFXJK9+sYORfWXeWHFExQ0ptvRMnDFpSbzw0oNfgZpnkk5KkIpG2pAU2QSHXyQ 86ZUuDn6aE5UX0hAbsHboXzMG5Fzrhq6Jy1gLr3eg5hauiSaLJo9woa999GK+ALt mtMKJyqyklsw7BORXgrEAL97L0peFO6EH8gmb27Vz9UgdQvaq8PnJ8QQ2MNVOn4P hXWFca8lAGcWxUSosCOTqoiuExxSmM2cCKKA1rwIcP6k6m4aB4XKmn8qv8ZzfUeG iQ7ol8Gkc5MA8snljL5AexPYNllXe+N7/Q1GjEu7lvqr28/yo/hixOUU7PKXQWSW 0kSeYop6dX5tEg/aiU6d =LSvi -----END PGP SIGNATURE----- --IJpNTDwzlM2Ie8A6-- --===============1695268774348691822== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1695268774348691822==--