[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] lsi53c895a: check script ram address value
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] lsi53c895a: check script ram address value |
Date: |
Tue, 6 Nov 2018 13:22:48 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 06/11/2018 13:03, Peter Maydell wrote:
> When can this masking have any effect? These functions are
> the read and write ops for lsi_ram_ops, which we register with
> memory_region_init_io(&s->ram_io, OBJECT(s), &lsi_ram_ops, s,
> "lsi-ram", 0x2000);
> which specifies a memory region size of 0x2000. So the input
> addr must be in the 0..0x1fff range already -- or have I missed
> something ?
>
> It would probably be helpful (for readers and static analysers)
> to assert() that addr is < 0x2000, though.
Indeed, there are cases where the address is used blindly in a memcpy
with size>1, but this is not one of them.
Paolo