diff options
author | Alan Modra <amodra@gmail.com> | 2023-07-26 09:54:03 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-07-26 10:23:27 +0930 |
commit | 477c9f2ba26ccd77016f2c97941fc8b35e332e35 (patch) | |
tree | 7101fd32ce2079ad0dc7006ddf9d54251af2b320 /gprof/aarch64.c | |
parent | eb14a8b4bfb767beebfb54d7911da4132b5c0f94 (diff) | |
download | gdb-477c9f2ba26ccd77016f2c97941fc8b35e332e35.zip gdb-477c9f2ba26ccd77016f2c97941fc8b35e332e35.tar.gz gdb-477c9f2ba26ccd77016f2c97941fc8b35e332e35.tar.bz2 |
PR30657, gprof heap buffer overflow
PR 30657
* cg_arcs.c (cg_assemble): Sanity check find_call addresses.
* i386.c (i386_find_call): Don't access past end of core_text_space.
* aarch64.c (aarch64_find_call): Round up lowpc, round down highpc.
* alpha.c (alpha_find_call): Likewise.
* mips.c (mips_find_call): Likewise.
* sparc.c (sparc_find_call): Likewise.
* vax.c (vax_find_call): Sanity check core_text_space accesses.
Diffstat (limited to 'gprof/aarch64.c')
-rw-r--r-- | gprof/aarch64.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gprof/aarch64.c b/gprof/aarch64.c index 68febf9..3ab6067 100644 --- a/gprof/aarch64.c +++ b/gprof/aarch64.c @@ -54,7 +54,8 @@ aarch64_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc) DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n", parent->name, (unsigned long) p_lowpc, (unsigned long) p_highpc)); - + p_lowpc = (p_lowpc + 3) & ~3; + p_highpc &= ~3; for (pc = p_lowpc; pc < p_highpc; pc += 4) { |