[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3 1/2] x86_64,signal: Fix SS handling for signals delivered to 64-bit programs
On Thu, Mar 12, 2015 at 01:57:51PM -0700, Andy Lutomirski wrote:
> From: Andy Lutomirski <>
> The comment in the signal code says that apps can save/restore other
> segments on their own. It's true that apps can *save* SS on their
> own, but there's no way for apps to restore it: SYSCALL effectively
> resets SS to __USER_DS, so any value that user code tries to load
> into SS gets lost on entry to sigreturn.
> This recycles two padding bytes in the segment selector area for SS.
> While we're at it, we need a second change to make this useful. If
> the signal we're delivering is caused by a bad SS value, saving that
> value isn't enough. We need to remove that bad value from the regs
> before we try to deliver the signal. Oddly, x32 already got this
> right.
> I suspect that 64-bit programs that try to run 16-bit code and use
> signals will have a lot of trouble without this.
> Signed-off-by: Andy Lutomirski <>

Acked-by: Borislav Petkov <>


ECO tip #101: Trim your mails when you reply.

 \ /
  Last update: 2015-03-13 17:21    [W:0.106 / U:4.076 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site