From: Stas Sergeev <stsp@list.ru>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>,
Pavel Emelyanov <xemul@parallels.com>,
Borislav Petkov <bp@alien8.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Brian Gerst <brgerst@gmail.com>, X86 ML <x86@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC 3/4] x86/signal/64: Re-add support for SS in the 64-bit signal context
Date: Wed, 14 Oct 2015 21:34:09 +0300 [thread overview]
Message-ID: <561EA021.9060901@list.ru> (raw)
In-Reply-To: <CALCETrUaaGcFzJSgMy16TqMdEPSioQDY3avTxb3Ra297-E3Tqg@mail.gmail.com>
14.10.2015 21:06, Andy Lutomirski пишет:
>> Also it doesn't seem to be saying what happens if CS is 32-bit
>> and SS is invalid (the flag is not set).
>
> A new signal will be delivered. sigreturn doesn't modify its behavior
> in this case -- it does the default thing, which is to honor the SS in
> the saved context.
Hmm, no, it didn't do this in the past for sure.
It simply ignored SS, no matter to what mode it returns.
> So it will actually try to use that saved SS
> value, which will fail, causing SIGSEGV.
So it seems this logic assumes that when dosemu returns to 32bit,
the previous SS is always still valid, am I right with the understanding?
I.e. the one that kernel have saved on a signal delivery (because
old dosemu does not overwrite it).
If it is so, I'd say this assumption is very risky and will likely
not hold. But maybe I am missing the point.
>>>> - with siglongjmp()
>>>
>>> siglongjmp is a glibc thing. It should work the same way it always
>>> did. If it internally does a syscall (sigprocmask or whatever), that
>>> will override SS.
>> IMHO this side-effect needs to be documented somewhere.
>> I was scared about using it because I thought SS could be left bad.
>> Why I think it IS the kernel's problem is because in an ideal world
>> the sighandler should not run with LDT SS at all, so there will be no
>> fear about a bad SS after siglongjmp().
>
> I agree, but that ship sailed quite a few years ago :(
Please, once again you are claiming there were no solutions proposed
in that area. :(
If you didn't repeatedly ignore the SA_hyz solution, there will be the
chance to do exactly that. But whatever.
next prev parent reply other threads:[~2015-10-14 18:34 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 1:04 [RFC 0/4] x86: sigcontext SS fixes, take 2 Andy Lutomirski
2015-10-13 1:04 ` [RFC 1/4] x86/signal/64: Add a comment about sigcontext->fs and gs Andy Lutomirski
2015-10-13 1:04 ` [RFC 2/4] x86/signal/64: Fix SS if needed when delivering a 64-bit signal Andy Lutomirski
2015-10-13 1:04 ` [RFC 3/4] x86/signal/64: Re-add support for SS in the 64-bit signal context Andy Lutomirski
2015-10-13 14:59 ` Stas Sergeev
2015-10-14 15:01 ` Ingo Molnar
2015-10-14 15:09 ` Stas Sergeev
2015-10-14 16:40 ` Andy Lutomirski
2015-10-14 17:40 ` Stas Sergeev
2015-10-14 18:06 ` Andy Lutomirski
2015-10-14 18:34 ` Stas Sergeev [this message]
2015-10-14 18:52 ` Andy Lutomirski
2015-10-14 21:37 ` Stas Sergeev
2015-10-14 21:41 ` Andy Lutomirski
2015-10-18 13:36 ` Stas Sergeev
2015-10-18 16:12 ` Andy Lutomirski
2015-10-18 16:29 ` Stas Sergeev
2015-10-18 16:36 ` Andy Lutomirski
2015-10-18 16:43 ` Stas Sergeev
2015-10-18 17:06 ` Andy Lutomirski
2015-10-14 16:40 ` Cyrill Gorcunov
2015-10-14 16:42 ` Andy Lutomirski
2015-10-14 16:57 ` Cyrill Gorcunov
2015-10-14 16:57 ` Stas Sergeev
2015-10-14 17:01 ` Cyrill Gorcunov
2015-10-13 1:04 ` [RFC 4/4] selftests/x86: Add tests for UC_SIGCONTEXT_SS and UC_STRICT_RESTORE_SS Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=561EA021.9060901@list.ru \
--to=stsp@list.ru \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=gorcunov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
--cc=xemul@parallels.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox