From nobody Mon Nov 25 01:30:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1719400125; cv=none; d=zohomail.com; s=zohoarc; b=KWaG+6VG5P/3x8Deu/p/cwY2hzdUjOckBdYGVDbGuOxC5Ze8aDjbnZwemltuk2BE1QLvMVFjouUbqcFeLKZosNzgHBCPU0iBjIxJPYUFasdYtyhNOtm108lOPZsgQ5zUAwq6V92H2tG0TvV8pfGQJXbwE6tSq5dY13EJxc3NZ5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719400125; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UtuCMhxUWw1DUkDzmxPc06M4yVAzJqdA967oAcSFqUQ=; b=UqHhjXLLMaPahHS+My3G+L/ijKMGnMbP6VgD1uptJM9vVldG4JphQxZlWdATI+3yINnBoNII7yC0HgLM3ThdLyVEIx+TcEF6+Xw7HFdKSL4Bg1ZL2ECPBvGNQSo7QRdf6AOgdHdyI5zGqfZ6ACxSQThox9G7QboLTwuX2/uCJWE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719400125154790.1702550410707; Wed, 26 Jun 2024 04:08:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQV3-00065k-VL; Wed, 26 Jun 2024 07:07:41 -0400 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 1sMQUb-0005mp-Os for qemu-devel@nongnu.org; Wed, 26 Jun 2024 07:07:13 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMQUa-0004jD-AY for qemu-devel@nongnu.org; Wed, 26 Jun 2024 07:07:13 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-706a4a04891so780217b3a.3 for ; Wed, 26 Jun 2024 04:07:10 -0700 (PDT) Received: from localhost ([157.82.204.135]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-706953ca94dsm3374624b3a.199.2024.06.26.04.07.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Jun 2024 04:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1719400029; x=1720004829; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=UtuCMhxUWw1DUkDzmxPc06M4yVAzJqdA967oAcSFqUQ=; b=SJeHWumu0ADDAZqcqWySPr/apWvWYfN1p/9LGJNIguUIu6/3O45VqtGvkrkwMR7F67 MJDq00f5BYKOehSaJ0aGAcXjSqI3pYDBEFCeLu8gNn+iJqep/WQUH4RBs65Oa/ypIPbJ Z4u5NYh9i71DUVT1q+GpbRLXOKDaB1KAoIEuiGDGCfbTaVlYnisGX2l1VSDfuHpThRZs H6SPPhhjpifmbTZMV5BTEMyFIzLHmnG8q35N7JjelQYcCoxD/F2ReCxGEF8B8K9o3Cqh 0vWeepOmpZdvM8YWMGPkU4fnH3puK5DgvC+igwO5zm1ECh0J0diXzgjxC2MDnosrLKvs j0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719400029; x=1720004829; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UtuCMhxUWw1DUkDzmxPc06M4yVAzJqdA967oAcSFqUQ=; b=UJfqCbM5kvdAye53p5WNmIwi+t3Sjmcg56u14ros+7wePcLhXla0yKu153JTJdQUkj nFh0fOWNhD6VmJbvYeQa3WqxgCvwMUFy8hwuHzACHYKXX0NMwF2iNgHrtoGQSVoQxmTL 3qHe2KPB7gPIIhV7kcJLwwUoTq+V/n/CmMXqzMtj10jw3qmhk+jmKq22lHF/mEFDJdSW +5CZKrwKn5DpnJL1eh/sLsEdacNQKqad9jSd8MzCyziZjv0mf627CcLkYpkk6V76wqU+ Fe0NImLWcb84+eLgOTfB2lXC/eribwm4wsreKK8p1qkzEwXZb4SnahVwdRvOV+s6x+Lg Mchw== X-Gm-Message-State: AOJu0Yxty+dadKxuy6Pv2lH0nH8IjhaQiW6sii3m/OwKUX1Ry8P8mLv9 z1UmHArLI6AQJKILJLeHmoGwq8kmE9Mj9brTlAPKgoky7TOeX2eZXmH8CUR6LMM= X-Google-Smtp-Source: AGHT+IF3Dc+m0QChTJ3J+oL5hbq9A7fYtNIurG9m8CclKzIjtqkWKlYcuGP9lQhN+pnh+ee0yqYcZQ== X-Received: by 2002:a05:6a00:2b8:b0:6ec:da6c:fc2d with SMTP id d2e1a72fcca58-70670fd4341mr8138448b3a.23.1719400029011; Wed, 26 Jun 2024 04:07:09 -0700 (PDT) From: Akihiko Odaki Date: Wed, 26 Jun 2024 20:06:28 +0900 Subject: [PATCH 05/14] ppc/vof: Fix unaligned FDT property access MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240626-san-v1-5-f3cc42302189@daynix.com> References: <20240626-san-v1-0-f3cc42302189@daynix.com> In-Reply-To: <20240626-san-v1-0-f3cc42302189@daynix.com> To: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yanan Wang , John Snow , BALATON Zoltan , Jiaxun Yang , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Alexey Kardashevskiy , "Michael S. Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , Fabiano Rosas , Paolo Bonzini , David Hildenbrand , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::436; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1719400125897100003 FDT properties are aligned by 4 bytes, not 8 bytes. Signed-off-by: Akihiko Odaki --- hw/ppc/vof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c index e3b430a81f4f..b5b6514d79fc 100644 --- a/hw/ppc/vof.c +++ b/hw/ppc/vof.c @@ -646,7 +646,7 @@ static void vof_dt_memory_available(void *fdt, GArray *= claimed, uint64_t base) mem0_reg =3D fdt_getprop(fdt, offset, "reg", &proplen); g_assert(mem0_reg && proplen =3D=3D sizeof(uint32_t) * (ac + sc)); if (sc =3D=3D 2) { - mem0_end =3D be64_to_cpu(*(uint64_t *)(mem0_reg + sizeof(uint32_t)= * ac)); + mem0_end =3D ldq_be_p(mem0_reg + sizeof(uint32_t) * ac); } else { mem0_end =3D be32_to_cpu(*(uint32_t *)(mem0_reg + sizeof(uint32_t)= * ac)); } --=20 2.45.2