From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 81E05385840B; Fri, 24 Dec 2021 13:35:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81E05385840B From: "jinoh.kang.kr at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug backtrace/28721] New: Stack buffer overrun in i386_unwind_pc Date: Fri, 24 Dec 2021 13:35:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: backtrace X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: jinoh.kang.kr at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security? X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Dec 2021 13:35:27 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28721 Bug ID: 28721 Summary: Stack buffer overrun in i386_unwind_pc Product: gdb Version: HEAD Status: UNCONFIRMED Severity: critical Priority: P2 Component: backtrace Assignee: unassigned at sourceware dot org Reporter: jinoh.kang.kr at gmail dot com Target Milestone: --- Flags: security? Created attachment 13876 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D13876&action=3Ded= it Sample program that triggers crash i386_unwind_pc calls frame_unwind_register with a 8-byte buffer, which can overrun if a wider register (e.g. [XYZ]MM registers) is specified as the re= turn address register. An example debugging session that reproduces the crash: $ gcc -o test gdb-unwind-pc-overrun.S # from attachment $ gdb -q ./test Reading symbols from ./test... (No debugging symbols found in ./test) (gdb) start Temporary breakpoint 1 at 0x401106 Starting program: /home/user/trxu/test=20 Temporary breakpoint 1, 0x0000000000401106 in main () (gdb) stepi # (or bt) *** stack smashing detected ***: terminated Aborted (core dumped) This bug should be trivial to fix: use frame_unwind_register_unsigned inste= ad (unless there are semantic differences between frame_unwind_register and frame_unwind_register_unsigned that I missed). --=20 You are receiving this mail because: You are on the CC list for the bug.=