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/22396] x86-64: siglongjmp does not restore PKRU register


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

Dave Hansen <dave at sr71 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dave at sr71 dot net

--- Comment #4 from Dave Hansen <dave at sr71 dot net> ---
It should also be noted that this issue also applies to MPX which has a lot
more state than protection keys.  (BNDSTATUS (8) + BNDCFGU (8) +
BNDREGS0-3(4*16)).  The ABI for BNDREGS probably saves us here at least partly
because it's pretty arguable that the registers are clobber at siglongjmp.  But
BNDCFGU which turns the feature on/off is a problem.

Back to PK... The manpage (http://man7.org/linux/man-pages/man7/pkeys.7.html)
could use some additional clarity here, but it does mention the signal
behavior, and also says:

    The rights of any interrupted context are
    restored when the signal handler returns.

We could clarify that we truly mean sys_sigreturn() and that other mechanisms
don't count as "returning".

The kernel _could_ detect when someone unblocks signals from inside a signal
handler, but without doing a sys_sigreturn().  We could theoretically take some
action there.  Does that do us any good?

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