Re: [PATCH] system/physmem: Fix UBSan finding in address_space_write_rom_internal

2025-05-14 Thread Peter Xu
On Fri, May 09, 2025 at 11:22:10AM -0400, Peter Xu wrote: > On Tue, May 06, 2025 at 02:21:08PM +0100, Peter Maydell wrote: > > On Mon, 5 May 2025 at 23:23, Joe Komlodi wrote: > > > > > > address_space_write_rom_internal can take in a NULL pointer for ptr if > > > it's only doing cache flushes inst

Re: [PATCH] system/physmem: Fix UBSan finding in address_space_write_rom_internal

2025-05-09 Thread Peter Xu
On Tue, May 06, 2025 at 02:21:08PM +0100, Peter Maydell wrote: > On Mon, 5 May 2025 at 23:23, Joe Komlodi wrote: > > > > address_space_write_rom_internal can take in a NULL pointer for ptr if > > it's only doing cache flushes instead of populating the ROM. > > > > However, if building with --enabl

Re: [PATCH] system/physmem: Fix UBSan finding in address_space_write_rom_internal

2025-05-06 Thread Peter Maydell
On Mon, 5 May 2025 at 23:23, Joe Komlodi wrote: > > address_space_write_rom_internal can take in a NULL pointer for ptr if > it's only doing cache flushes instead of populating the ROM. > > However, if building with --enable-ubsan, incrementing buf causes ubsan > to go off when doing cache flushes

Re: [PATCH] system/physmem: Fix UBSan finding in address_space_write_rom_internal

2025-05-06 Thread Peter Xu
On Mon, May 05, 2025 at 10:22:36PM +, Joe Komlodi wrote: > address_space_write_rom_internal can take in a NULL pointer for ptr if > it's only doing cache flushes instead of populating the ROM. > > However, if building with --enable-ubsan, incrementing buf causes ubsan > to go off when doing ca

[PATCH] system/physmem: Fix UBSan finding in address_space_write_rom_internal

2025-05-05 Thread Joe Komlodi
address_space_write_rom_internal can take in a NULL pointer for ptr if it's only doing cache flushes instead of populating the ROM. However, if building with --enable-ubsan, incrementing buf causes ubsan to go off when doing cache flushes, since it will trigger on pointer arithmetic on a NULL poin