Re: [PATCH] softmmu/memory: Validate {read,write}_with_attrs before calling

2021-09-05 Thread Paolo Bonzini
On 05/09/21 18:29, Peter Maydell wrote: Last time this came up, we discussed the other option, which is to have memory_region_init assert that the MemoryRegionOps defines at least one valid read and one valid write pointer, so that these bugs get caught quickly rather than only if the guest acces

Re: [PATCH] softmmu/memory: Validate {read, write}_with_attrs before calling

2021-09-05 Thread Peter Maydell
On Sun, 5 Sept 2021 at 18:07, Bin Meng wrote: > > On Mon, Sep 6, 2021 at 12:54 AM Peter Maydell > wrote: > > I mean that before commit 62a0db942dec leaving the pointers all > > NULL was not allowed, and after that commit leaving the pointers all > > NULL was still not allowed. It's been a requir

Re: [PATCH] softmmu/memory: Validate {read, write}_with_attrs before calling

2021-09-05 Thread Bin Meng
On Mon, Sep 6, 2021 at 12:54 AM Peter Maydell wrote: > > On Sun, 5 Sept 2021 at 17:49, Bin Meng wrote: > > > > On Mon, Sep 6, 2021 at 12:29 AM Peter Maydell > > wrote: > > > > > > On Sun, 5 Sept 2021 at 16:40, Bin Meng wrote: > > > > > > > > {read,write}_with_attrs might be missing, and the co

Re: [PATCH] softmmu/memory: Validate {read, write}_with_attrs before calling

2021-09-05 Thread Peter Maydell
On Sun, 5 Sept 2021 at 17:49, Bin Meng wrote: > > On Mon, Sep 6, 2021 at 12:29 AM Peter Maydell > wrote: > > > > On Sun, 5 Sept 2021 at 16:40, Bin Meng wrote: > > > > > > {read,write}_with_attrs might be missing, and the codes currently do > > > not validate them before calling, which will caus

Re: [PATCH] softmmu/memory: Validate {read, write}_with_attrs before calling

2021-09-05 Thread Bin Meng
On Mon, Sep 6, 2021 at 12:29 AM Peter Maydell wrote: > > On Sun, 5 Sept 2021 at 16:40, Bin Meng wrote: > > > > {read,write}_with_attrs might be missing, and the codes currently do > > not validate them before calling, which will cause segment fault. > > > > Fixes: 62a0db942dec ("memory: Remove ol

Re: [PATCH] softmmu/memory: Validate {read, write}_with_attrs before calling

2021-09-05 Thread Peter Maydell
On Sun, 5 Sept 2021 at 16:40, Bin Meng wrote: > > {read,write}_with_attrs might be missing, and the codes currently do > not validate them before calling, which will cause segment fault. > > Fixes: 62a0db942dec ("memory: Remove old_mmio accessors") > Signed-off-by: Bin Meng This 'fixes' tag does

Re: [PATCH] softmmu/memory: Validate {read, write}_with_attrs before calling

2021-09-05 Thread Philippe Mathieu-Daudé
Cc'ing PJP for https://www.mail-archive.com/qemu-devel@nongnu.org/msg730311.html On Sun, Sep 5, 2021 at 5:41 PM Bin Meng wrote: > > {read,write}_with_attrs might be missing, and the codes currently do > not validate them before calling, which will cause segment fault. > > Fixes: 62a0db942dec ("me

[PATCH] softmmu/memory: Validate {read, write}_with_attrs before calling

2021-09-05 Thread Bin Meng
{read,write}_with_attrs might be missing, and the codes currently do not validate them before calling, which will cause segment fault. Fixes: 62a0db942dec ("memory: Remove old_mmio accessors") Signed-off-by: Bin Meng --- softmmu/memory.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletion