New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Mar 2018

Sign in to add a comment

Issue 4403: NaCl hardware exception handling not working on newer x86-64 Linux kernels

Reported by, Mar 15 2018 Project Member

Issue description

Newer versions of the Linux kernel have apparently made a change that breaks NaCl's hardware exception handling.

This was reported here:

Linux has apparently changed the meaning of the REG_CSGSFS field of mcontext_t.  The top 16 bits used to be unused (labelled as "__pad0" in a comment), but now they're used for the %ss register's value.

NaCl unnecessarily copies the %cs, %gs and %fs values out of this field and back in, and in doing so it resets the top 16 bits (see

When NaCl returns from the signal handler with REG_CSGSFS reset, Linux generates another signal (this time with si_code==SI_KERNEL), which causes NaCl to terminate the process.

Comment 1 by, Mar 15 2018

Project Member
The following revision refers to this bug:

commit 303fc9961cb4231aa9828218362914ee4e51d16a
Author: Andrew Bonventre <>
Date: Thu Mar 15 23:24:45 2018

x86-64 Linux: don't update segment registers using the sig_ctx

In some cases, the linux kernel considers the values set in
mctx->gregs[REG_CSGSFS] to be invalid, preventing it from
resuming execution of the process after the rt_sigreturn syscall
and sending the process a SIGSEGV with an SI_KERNEL code.

Some NaCl tests are failing on Mac and arm-hw-perf trybots,
so committing with "No-Try: True".

No-Try: True
Change-Id: I59726a7e8e7d898171a452433484a0502f93f647
Commit-Queue: Mark Seaborn <>
Reviewed-by: Mark Seaborn <>


Comment 2 by, Mar 16 2018

 Issue chromium:821943  has been merged into this issue.

Comment 3 by, Mar 22 2018

Project Member
Status: Fixed (was: Available)
For the record, this was the commit in Linux that introduced this issue:

"x86/signal/64: Re-add support for SS in the 64-bit signal context"

(That was also linked from  issue chromium:821943 .)

Sign in to add a comment