This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/16098] New: Wrong argument for longjmp_target's LIBC_PROBE in i386


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

            Bug ID: 16098
           Summary: Wrong argument for longjmp_target's LIBC_PROBE in i386
           Product: glibc
           Version: 2.16
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: tdaitx at gmail dot com
                CC: drepper.fsp at gmail dot com

Created attachment 7260
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7260&action=edit
Fix i386 longjmp_target probe argument

The file sysdeps/i386/__longjmp.S has an error (a possible typo) in line 68.

LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)

The fourth argument should actually be -4@%eax, as it is expected to be equal
to the return value (second argument of the longjmp function).

It's easy to see the problem by comparing both pairs of longjmp/longjmp_target
user probes in i386 longjmp code:

With pointer demangling
35         LIBC_PROBE (longjmp, 3, 4@%eax, -4@8(%esp), 4@%edx)
53  LIBC_PROBE (longjmp_target, 3, 4@%eax, -4@8(%esp), 4@%edx)

Without pointer demangling
58         movl 8(%esp), %eax      /* Second argument is return value.  */
61         LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
68  LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)


One can also compare it with the probe on
sysdeps/unix/sysv/linux/i386/____longjmp_chk.S:
93         movl    8(%esp), %eax   /* Second argument is return value.  */
107 LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%eax, 4@%edx)


Affects glibc 2.16+

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]