All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Pavel Emelyanov <xemul@parallels.com>,
	Oleg Nesterov <oleg@redhat.com>, Andrey Wagin <avagin@gmail.com>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Andi Kleen <andi@firstfloor.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Al Viro <viro@zeniv.linux.org.uk>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Borislav Petkov <bp@alien8.de>,
	Pavel Emelyanov <xemul@openvz.org>
Subject: Re: [PATCH v3 1/2] x86_64,signal: Fix SS handling for signals delivered to 64-bit programs
Date: Thu, 19 Mar 2015 09:08:08 -0700	[thread overview]
Message-ID: <CALCETrVHxd3=AeGTojsMgN019CJ17DrD=fT3mrkwZbLtqM6t_g@mail.gmail.com> (raw)
In-Reply-To: <20150319073512.GA27066@moon>

On Thu, Mar 19, 2015 at 12:35 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> On Wed, Mar 18, 2015 at 03:03:27PM -0700, Andy Lutomirski wrote:
>> On Wed, Mar 18, 2015 at 2:34 PM, Pavel Emelyanov <xemul@parallels.com> wrote:
>> > On 03/19/2015 12:26 AM, Andy Lutomirski wrote:
>> >> On Wed, Mar 18, 2015 at 1:02 PM, Oleg Nesterov <oleg@redhat.com> wrote:
>> >>> On 03/18, Andrey Wagin wrote:
>> >>>>
>> >>>> This patch fixes the problem. Oleg, could you send this path in the
>> >>>> criu maillist?
>> >>>
>> >>> Sure, will do.
>> >>
>> >> We still haven't answered one question: what's the kernel's position
>> >> on ABI stability wrt CRIU?  We clearly shouldn't make changes that
>> >> break the principle of CRIU, but CRIU encodes so many tricky
>> >> assumptions about the inner workings of the kernel that it's really
>> >> tough to avoid breaking old CRIU versions.
>> >
>> > Well, we try hard to use only documented kernel API-s. Isn't the sigframe
>> > considered to be some sort of "stable API"? I mean -- it's visible by the
>> > userspace, nobody prevents glibc or gdb from messing with this stuff just
>> > by reading it from memory.
>> >
>> > If it's "parse-able" e.g. like VDSO is, but we don't do it in CRIU -- then
>> > it's definitely a CRIU BUG to be fixed.
>>
>> It's certainly parseable by things like gdb.  But it's also supposed
>> to be extensible.  hpa, any thoughts here?
>>
>> >
>> >> So... do we introduce somewhat nasty code into the kernel to keep old
>> >> CRIU versions working, or do we require that users who want to restore
>> >> onto new kernels use new CRIU?
>> >
>> > It's OK (I think) to require newer versions of CRIU, it's easy to update
>> > one unlike the kernel ;)
>> >
>> > But if "old" version of CRIU just crash the restored processes on "new"
>> > kernels and there's no way to detect this properly -- that's the problem.
>>
>> Yeah, that's unfortunate.
>>
>> I don't have a great idea for how to work around this, unfortunately.
>> Ideally we'd increment some kind of version counter or use an
>> extension mechanism rather than shoving ss into a field that used to
>> be padding.
>
> fwiw currently we're passing zero in this __pad0 (replying to your
> previous email, so we can workaround in the kernel assuming zero
> as a special case, not that good but better than nothing).

We could store ss_plus_one instead of ss.  Yuck.

The only real down side I can see to special casing zero is that it
really is possible to end up with zero in there.  For example, the
SIGSEGV you get do to the failed sigreturn probably has sigcontext->ss
== 0 :)

--Andy

>
>>
>> --Andy
>>
>> >
>> >> (It seems clear to me that CRIU should apply the patch regardless of
>> >> what the kernel does.  It will enable CRIU to work on the same class
>> >> of programs that are fixed by the kernel change that started this
>> >> thread.)
>> >>
>> >> --Andy
>> >> .
>> >>
>> >
>> > Thanks,
>> > Pavel
>> >
>>
>>
>>
>> --
>> Andy Lutomirski
>> AMA Capital Management, LLC
>>
>
>         Cyrill



-- 
Andy Lutomirski
AMA Capital Management, LLC

  reply	other threads:[~2015-03-19 16:08 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12 20:57 [PATCH v3 0/2] x86_64: Sigcontext improvements Andy Lutomirski
2015-03-12 20:57 ` [PATCH v3 1/2] x86_64,signal: Fix SS handling for signals delivered to 64-bit programs Andy Lutomirski
2015-03-13 16:13   ` Borislav Petkov
2015-03-16  8:11   ` Ingo Molnar
2015-03-16 12:08   ` [tip:x86/asm] x86/signal/64: " tip-bot for Andy Lutomirski
2015-03-17  8:44   ` tip-bot for Andy Lutomirski
2015-03-18 17:19   ` [PATCH v3 1/2] x86_64,signal: " Andrey Wagin
2015-03-18 17:48     ` Oleg Nesterov
2015-03-18 18:06       ` Andy Lutomirski
2015-03-18 18:17         ` Cyrill Gorcunov
2015-03-18 18:20           ` Andy Lutomirski
2015-03-18 18:45             ` Cyrill Gorcunov
2015-03-18 18:25           ` Oleg Nesterov
2015-03-18 18:32             ` Andy Lutomirski
2015-03-18 19:13             ` Cyrill Gorcunov
2015-03-18 18:13       ` Cyrill Gorcunov
2015-03-18 18:31         ` Oleg Nesterov
2015-03-18 18:50           ` Cyrill Gorcunov
2015-03-18 19:52             ` Andrey Wagin
2015-03-18 20:02               ` Oleg Nesterov
2015-03-18 21:26                 ` Andy Lutomirski
2015-03-18 21:34                   ` Pavel Emelyanov
2015-03-18 22:03                     ` Andy Lutomirski
2015-03-19  7:35                       ` Cyrill Gorcunov
2015-03-19 16:08                         ` Andy Lutomirski [this message]
2015-03-19 16:19                           ` Cyrill Gorcunov
2015-03-20 11:43                         ` Denys Vlasenko
2015-03-20 11:56                           ` Cyrill Gorcunov
2015-03-20 12:04                             ` Cyrill Gorcunov
2015-03-20 14:07                               ` Oleg Nesterov
2015-03-20 14:47                                 ` Cyrill Gorcunov
2015-04-10 21:59                                   ` Andy Lutomirski
2015-04-10 22:11                                     ` Cyrill Gorcunov
2015-04-10 22:16                                       ` Andy Lutomirski
2015-04-10 22:20                                         ` Cyrill Gorcunov
2015-03-12 20:57 ` [PATCH v3 2/2] x86_64,signal: Remove 'fs' and 'gs' from sigcontext Andy Lutomirski
2015-03-16 12:08   ` [tip:x86/asm] x86/signal/64: " tip-bot for Andy Lutomirski
2015-03-17  8:44   ` tip-bot for Andy Lutomirski
2015-03-13 15:31 ` [PATCH v3 0/2] x86_64: Sigcontext improvements Oleg Nesterov

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='CALCETrVHxd3=AeGTojsMgN019CJ17DrD=fT3mrkwZbLtqM6t_g@mail.gmail.com' \
    --to=luto@amacapital.net \
    --cc=andi@firstfloor.org \
    --cc=avagin@gmail.com \
    --cc=bp@alien8.de \
    --cc=gorcunov@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.org \
    --cc=xemul@openvz.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.