public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/30706] New: dynamic-stack-buffer-overflow /home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/ada-lang.c:1391 in ada_decode[abi:cxx11](char const*, bool, bool)
@ 2023-07-31 12:00 sihan2021 at iscas dot ac.cn
  2023-08-01 15:10 ` [Bug gdb/30706] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: sihan2021 at iscas dot ac.cn @ 2023-07-31 12:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30706

            Bug ID: 30706
           Summary: dynamic-stack-buffer-overflow
                    /home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/ada-l
                    ang.c:1391 in ada_decode[abi:cxx11](char const*, bool,
                    bool)
           Product: gdb
           Version: 13.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: sihan2021 at iscas dot ac.cn
  Target Milestone: ---

Created attachment 15026
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15026&action=edit
crash seed

Hello, developers of gdb, we recently ran some fuzz on gdb 13.1 and find a
stack-buffer-overflow  bug. Here is the description of this bug. I hope this
can accsit you to solve this bug.

Version:
gdb 13.1 (compile with ASAN) 
ubuntu 20.04

Command to reproduce:
gdb dsbo

ASAN report:
==3117258==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address
0x7ffd4744605f at pc 0x55c23d0564a0 bp 0x7ffd47445bc0 sp 0x7ffd47445bb0
READ of size 1 at 0x7ffd4744605f thread T0
    #0 0x55c23d05649f in ada_decode[abi:cxx11](char const*, bool, bool)
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/ada-lang.c:1391
    #1 0x55c23d099aff in ada_language::sniff_from_mangled_name(char const*,
std::unique_ptr<char, gdb::xfree_deleter<char> >*) const
(/home/root/gdb/binutils-gdb-gdb-13.1-release/install/bin/gdb+0xba3aff)
    #2 0x55c23de773b7 in symbol_find_demangled_name(general_symbol_info*, char
const*) /home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symtab.c:892
    #3 0x55c23de77c84 in
general_symbol_info::compute_and_set_names(gdb::basic_string_view<char,
std::char_traits<char> >, bool, objfile_per_bfd_storage*,
gdb::optional<unsigned int>)
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symtab.c:980
    #4 0x55c23d3b7927 in process_coff_symbol
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/coffread.c:1572
    #5 0x55c23d3b55b0 in coff_symtab_read
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/coffread.c:1184
    #6 0x55c23d3b1da4 in coff_read_minsyms
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/coffread.c:554
    #7 0x55c23d3b2c07 in coff_symfile_read
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/coffread.c:703
    #8 0x55c23de3e421 in read_symbols
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:773
    #9 0x55c23de3f38a in syms_from_objfile_1
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:968
    #10 0x55c23de3f5f9 in syms_from_objfile
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:985
    #11 0x55c23de404f6 in symbol_file_add_with_addrs
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:1088
    #12 0x55c23de411fd in symbol_file_add_from_bfd(gdb::ref_ptr<bfd,
gdb_bfd_ref_policy> const&, char const*, enum_flags<symfile_add_flag>,
std::vector<other_sections, std::allocator<other_sections> >*,
enum_flags<objfile_flag>, objfile*)
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:1168
    #13 0x55c23de413a2 in symbol_file_add(char const*,
enum_flags<symfile_add_flag>, std::vector<other_sections,
std::allocator<other_sections> >*, enum_flags<objfile_flag>)
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:1181
    #14 0x55c23de4170c in symbol_file_add_main_1
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:1205
    #15 0x55c23de41558 in symbol_file_add_main(char const*,
enum_flags<symfile_add_flag>)
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symfile.c:1196
    #16 0x55c23d9cb8cf in symbol_file_add_main_adapter
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/main.c:540
    #17 0x55c23d9cb6bf in catch_command_errors
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/main.c:513
    #18 0x55c23d9ce58a in captured_main_1
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/main.c:1213
    #19 0x55c23d9cf48f in captured_main
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/main.c:1320
    #20 0x55c23d9cf530 in gdb_main(captured_main_args*)
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/main.c:1345
    #21 0x55c23cff8eb1 in main
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/gdb.c:32
    #22 0x7f08cb9e3082 in __libc_start_main ../csu/libc-start.c:308
    #23 0x55c23cff8c8d in _start
(/home/root/gdb/binutils-gdb-gdb-13.1-release/install/bin/gdb+0xb02c8d)

Address 0x7ffd4744605f is located in stack of thread T0 at offset 191 in frame
    #0 0x55c23de7712e in symbol_find_demangled_name(general_symbol_info*, char
const*) /home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/symtab.c:872

  This frame has 1 object(s):
    [32, 40) 'demangled' (line 873) <== Memory access at offset 191 overflows
this variable
HINT: this may be a false positive if your program uses some custom stack
unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: dynamic-stack-buffer-overflow
/home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/ada-lang.c:1391 in
ada_decode[abi:cxx11](char const*, bool, bool)
Shadow bytes around the buggy address:
  0x100028e80bb0: f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 00 00
  0x100028e80bc0: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
  0x100028e80bd0: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 f3 f3 f3 f3
  0x100028e80be0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100028e80bf0: 00 00 00 00 f1 f1 f1 f1 00 f3 f3 f3 00 00 00 00
=>0x100028e80c00: 00 00 00 00 00 00 00 00 ca ca ca[ca]03 cb cb cb
  0x100028e80c10: cb cb cb cb 00 00 00 00 00 00 00 00 00 00 00 00
  0x100028e80c20: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
  0x100028e80c30: f1 f1 f8 f2 00 f2 f2 f2 00 f2 f2 f2 00 00 f2 f2
  0x100028e80c40: f8 f8 f2 f2 00 00 f2 f2 00 00 f2 f2 00 00 f2 f2
  0x100028e80c50: 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/30706] dynamic-stack-buffer-overflow /home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/ada-lang.c:1391 in ada_decode[abi:cxx11](char const*, bool, bool)
  2023-07-31 12:00 [Bug gdb/30706] New: dynamic-stack-buffer-overflow /home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/ada-lang.c:1391 in ada_decode[abi:cxx11](char const*, bool, bool) sihan2021 at iscas dot ac.cn
@ 2023-08-01 15:10 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2023-08-01 15:10 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30706

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I wonder if COFF debug info is even relevant any more.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-01 15:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 12:00 [Bug gdb/30706] New: dynamic-stack-buffer-overflow /home/root/gdb/binutils-gdb-gdb-13.1-release/gdb/ada-lang.c:1391 in ada_decode[abi:cxx11](char const*, bool, bool) sihan2021 at iscas dot ac.cn
2023-08-01 15:10 ` [Bug gdb/30706] " tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).