Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Eric Blake
On 9/12/18 7:33 AM, Li Qiang wrote: Do you have a reproducer and/or a backtrace? memory_region_dispatch_write() checks if ops->write != NULL. FWIW, looking at the codebase, there's a good number of static MemoryRegionOps structures for which the "read_with_attrs" and "read" members are defau

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Li Qiang
Hi Laszlo, Laszlo Ersek 于2018年9月12日周三 下午6:36写道: > On 09/12/18 10:02, Li Qiang wrote: > > Hi, > > > > Marc-André Lureau 于2018年9月12日周三 下午3:16写道: > > > >> Hi > >> > >> On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: > >>> > >>> The write/read should be paired, this can avoid the > >>> NULL-deref

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Laszlo Ersek
On 09/12/18 10:02, Li Qiang wrote: > Hi, > > Marc-André Lureau 于2018年9月12日周三 下午3:16写道: > >> Hi >> >> On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: >>> >>> The write/read should be paired, this can avoid the >>> NULL-deref while the guest reads the fw_cfg port. >>> >>> Signed-off-by: Li Qiang

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Li Qiang
Hi, Marc-André Lureau 于2018年9月12日周三 下午3:16写道: > Hi > > On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: > > > > The write/read should be paired, this can avoid the > > NULL-deref while the guest reads the fw_cfg port. > > > > Signed-off-by: Li Qiang > > Do you have a reproducer and/or a backtra

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Marc-André Lureau
Hi On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: > > The write/read should be paired, this can avoid the > NULL-deref while the guest reads the fw_cfg port. > > Signed-off-by: Li Qiang Do you have a reproducer and/or a backtrace? memory_region_dispatch_write() checks if ops->write != NULL. >

[Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-11 Thread Li Qiang
The write/read should be paired, this can avoid the NULL-deref while the guest reads the fw_cfg port. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index d79a568f54..6de7809f1a 100644 --- a/hw/nvram/f