From nobody Mon Nov 25 02:36:46 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1719058087; cv=none; d=zohomail.com; s=zohoarc; b=UaZDFMagkfifELOaJwVZjfaD1NjnTbiJWDdB2pPFgfVkR+rjyQJ9S2mNta74W6CRM1fVXeyOds3iCdn4Vi6HRYTTDS4vZcML4AJKZMz0fkOmilLYh9SgEU1ShB7UBKBMjjbl6IDZ2F7YHSZ4p1YgHE0cclEJo7ZBDKJ5wo1XMZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1719058087; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=WwqCJKx+EEHLRl2w5KthXnNV4TeYWMHzkPurEgLrTbU=; b=cMcoOefmTHptKZR1kFbTIQA+p7f56+OWaxKBhvSAtU/cfwn7/hXeRNH87myAf+BN/DBYaUcxIMBR81E14ZAJMuF0WYTJS7Fx/V8/wI4BlBEtkwtyquUPUQcL9cQz7Te6pucgjg0rsQqw4wS3uB+MrRbllpj/1Jyl6rcKLEeWBAQ= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1719058087578180.0581157537257; Sat, 22 Jun 2024 05:08:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKzWK-0007zo-Vi; Sat, 22 Jun 2024 08:07:04 -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 1sKzWG-0007vp-VE for qemu-devel@nongnu.org; Sat, 22 Jun 2024 08:07:00 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKzWA-0000LH-M2 for qemu-devel@nongnu.org; Sat, 22 Jun 2024 08:06:56 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42108856c33so23050215e9.1 for ; Sat, 22 Jun 2024 05:06:53 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3663a2f698dsm4393006f8f.70.2024.06.22.05.06.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jun 2024 05:06:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719058012; x=1719662812; 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=WwqCJKx+EEHLRl2w5KthXnNV4TeYWMHzkPurEgLrTbU=; b=j117ZqU73RG9mgkA4m88kkRb1rdB1nKY9IlHhjXiv4q3VaLCr7qv2d1klwvWua87FY W5F+P3UiI0pLVTZbg4zN9SQKWOSc3G3y+YTBFMZRGrQSgJaiPjJil8honkCBQg64CIql x1LAWNmr+cBUn+pshlIlxJFUTfjJkgy2MtBTlTd1xBJ2ROmMF+t9xHr00PJIPNMEw90v PLnSiqZOqVg3A+t4Ahb3noY4BjItUowqylp6eaIu9ZUPlrYpWwO11jyBhvBcpZUyL6tk uw8GGApxh9RuRKypQ6AY76o9+vAQFsGgdyjYTAQeTRnBmQK21xhTZJn6Ll/1RunYCA5J Ppig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719058013; x=1719662813; 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=WwqCJKx+EEHLRl2w5KthXnNV4TeYWMHzkPurEgLrTbU=; b=Cq/uKTPRRi9y0WMZYBV7bljpQHvmL5fJGmrm4d8F/MjH2tE40VsJoC/uUmC5MoaV05 EIOGvRQheusINFHsfWGJxkuf4T6wOTdZvu/vzZuLSqvYyaX8mpdKfRZOJKtO5o6erCeO ZdePu3knOa9CnoZXA1bvCDyR/oTKLPE8Tsz7n4CmW3obe6jsId5SXKxJxiRF8v/Ilje7 xkhEQGcGzX308LQ01c+AMOTF19R7L2npo6zJMKhB7GazCHrDStJZY9vgg3oWIMutgs6F RDQzbbPXKQUC3zJq5U2zLVBdxhhsapJAqeUQk91MEvp7Cy7F8C7wWeAXGI0TBxSf6Sqg ARcA== X-Gm-Message-State: AOJu0YwWMVv4zb8mb5FOP0thOVdHTi1DMlwVgmL5yPJvpJZwUTPVKJ6V /2tW8BZ0NBmXSiQgU4ZUS9lfwvfua7WfI9TJyzXdAj6+KkOGjP7T9LkECZt+kyrpL4zmSrAWjfZ Fypo= X-Google-Smtp-Source: AGHT+IFjkhJfLxQgFeS6oxglr9jNWDEzISf9RyqBxToUJBWUJeHIi9b6h3PjAr9ACBufFQI7VsoH1A== X-Received: by 2002:a5d:4988:0:b0:362:f0a6:4d55 with SMTP id ffacd0b85a97d-366e3685c21mr743363f8f.18.1719058012703; Sat, 22 Jun 2024 05:06:52 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/18] hw/misc: Set valid access size for Exynos4210 RNG Date: Sat, 22 Jun 2024 13:06:41 +0100 Message-Id: <20240622120643.3797539-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240622120643.3797539-1-peter.maydell@linaro.org> References: <20240622120643.3797539-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1719058088897100009 From: Zheyu Ma The Exynos4210 RNG module requires 32-bit (4-byte) accesses to its register= s. According to the User Manual Section 25.3[1], the registers for RNG operati= ons are 32-bit. This change ensures that the memory region operations for the RNG module enforce the correct access sizes, preventing invalid memory acce= sses. [1] http://www.mediafire.com/view/8ly2fqls3c9c31c/Exynos_4412_SCP_Users_Man= ual_Ver.0.10.00_Preliminary0.pdf Reproducer: cat << EOF | qemu-system-aarch64 -display none \ -machine accel=3Dqtest, -m 512M -machine smdkc210 -qtest stdio readb 0x10830454 EOF Suggested-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zheyu Ma Message-id: 20240618163701.3204975-1-zheyuma97@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/misc/exynos4210_rng.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/misc/exynos4210_rng.c b/hw/misc/exynos4210_rng.c index 0756bd32059..674d8eece5f 100644 --- a/hw/misc/exynos4210_rng.c +++ b/hw/misc/exynos4210_rng.c @@ -217,6 +217,8 @@ static const MemoryRegionOps exynos4210_rng_ops =3D { .read =3D exynos4210_rng_read, .write =3D exynos4210_rng_write, .endianness =3D DEVICE_NATIVE_ENDIAN, + .valid.min_access_size =3D 4, + .valid.max_access_size =3D 4, }; =20 static void exynos4210_rng_reset(DeviceState *dev) --=20 2.34.1