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/1780] [i386] size of sigset_t in ucontext_t structure does not match linux kernel


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

Szabolcs Nagy <nszabolcs at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nszabolcs at gmail dot com

--- Comment #9 from Szabolcs Nagy <nszabolcs at gmail dot com> ---
a better example is

  sigfillset(&uc->uc_sigmask)

which must work on an uc passed to a signal handler,
but linux uc_sigmask is 8 bytes on i386 and glibc
writes 128 bytes so it clobbers the stack.

the only conforming fix is to wrap signal handlers
and translate kernel ucontext (since sigset_t is a
struct or int type that can be assigned), but a good
enough solution is to make all apis taking sigset_t*
argument to only access bytes that are relevant to
the linux kernel (in this case the first 8 bytes only).

-- 
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]