qemu/target
Philippe Mathieu-Daudé 40fed8c1d3 target/ppc: Replace g_memdup() by g_memdup2()
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538

  The old API took the size of the memory to duplicate as a guint,
  whereas most memory functions take memory sizes as a gsize. This
  made it easy to accidentally pass a gsize to g_memdup(). For large
  values, that would lead to a silent truncation of the size from 64
  to 32 bits, and result in a heap area being returned which is
  significantly smaller than what the caller expects. This can likely
  be exploited in various modules to cause a heap buffer overflow.

Replace g_memdup() by the safer g_memdup2() wrapper.

Trivially safe because the argument was directly from sizeof.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20210903174510.751630-27-philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2024-05-08 19:11:34 +02:00
..
alpha exec/cpu: Extract page-protection definitions to page-protection.h 2024-05-06 11:17:15 +02:00
arm Accelerator patches 2024-05-06 10:19:10 -07:00
avr accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
cris exec/cpu: Extract page-protection definitions to page-protection.h 2024-05-06 11:17:15 +02:00
hexagon Accelerator patches 2024-05-06 10:19:10 -07:00
hppa accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
i386 target/i386: remove duplicate prefix decoding 2024-05-07 08:53:26 +02:00
loongarch accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
m68k exec/cpu: Extract page-protection definitions to page-protection.h 2024-05-06 11:17:15 +02:00
microblaze accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
mips accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
openrisc accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
ppc target/ppc: Replace g_memdup() by g_memdup2() 2024-05-08 19:11:34 +02:00
riscv accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
rx accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
s390x exec/cpu: Extract page-protection definitions to page-protection.h 2024-05-06 11:17:15 +02:00
sh4 tcg: Add write_aofs to GVecGen3i 2024-05-07 07:34:58 -07:00
sparc qemu-sparc queue 2024-05-06 10:19:56 -07:00
tricore accel/tcg: Access tcg_cflags with getter / setter 2024-05-06 11:21:05 +02:00
xtensa exec/cpu: Extract page-protection definitions to page-protection.h 2024-05-06 11:17:15 +02:00
Kconfig meson: make target endianneess available to Kconfig 2024-05-03 15:47:47 +02:00
meson.build exec: Expose 'target_page.h' API to user emulation 2024-04-26 15:28:11 +02:00