From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Zheyu Ma <zheyuma97@gmail.com>,
Igor Mitsyanko <i.mitsyanko@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH v2] hw/misc: Set valid access size for Exynos4210 RNG
Date: Tue, 18 Jun 2024 17:58:02 +0200 [thread overview]
Message-ID: <f870bc0c-595a-4d9f-aac1-8361d70ea18f@linaro.org> (raw)
In-Reply-To: <20240618155159.3183256-1-zheyuma97@gmail.com>
On 18/6/24 17:51, Zheyu Ma wrote:
> This commit ensures that accesses to the RNG memory region are properly
> validated and align with expected access sizes.
Please point to the device specifications.
> Reproducer:
> cat << EOF | qemu-system-aarch64 -display none \
> -machine accel=qtest, -m 512M -machine smdkc210 -qtest stdio
> readb 0x10830454
> EOF
>
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
> ---
> 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 0756bd3205..674d8eece5 100644
> --- a/hw/misc/exynos4210_rng.c
> +++ b/hw/misc/exynos4210_rng.c
> @@ -217,6 +217,8 @@ static const MemoryRegionOps exynos4210_rng_ops = {
> .read = exynos4210_rng_read,
> .write = exynos4210_rng_write,
> .endianness = DEVICE_NATIVE_ENDIAN,
> + .valid.min_access_size = 4,
> + .valid.max_access_size = 4,
> };
>
> static void exynos4210_rng_reset(DeviceState *dev)
prev parent reply other threads:[~2024-06-18 15:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 15:51 [PATCH v2] hw/misc: Set valid access size for Exynos4210 RNG Zheyu Ma
2024-06-18 15:58 ` Philippe Mathieu-Daudé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f870bc0c-595a-4d9f-aac1-8361d70ea18f@linaro.org \
--to=philmd@linaro.org \
--cc=i.mitsyanko@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=zheyuma97@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).