From: Stas Sergeev <stsp@list.ru>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Oleg Nesterov <oleg@redhat.com>,
Linux kernel <linux-kernel@vger.kernel.org>,
Linux API <linux-api@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Amanieu d'Antras" <amanieu@gmail.com>,
Richard Weinberger <richard@nod.at>, Tejun Heo <tj@kernel.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Jason Low <jason.low2@hp.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Andrea Arcangeli <aarcange@redhat.com>,
Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
Josh Triplett <josh@joshtriplett.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Aleksa Sarai <cyphar@cyphar.com>, Paul Moore <pmoore@redhat.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Vladimir Davydov <vdavydov@parallels.com>
Subject: Re: [PATCH 4/4] sigaltstack: allow disabling and re-enabling sas within sighandler
Date: Mon, 1 Feb 2016 21:40:52 +0300 [thread overview]
Message-ID: <56AFA6B4.8030808@list.ru> (raw)
In-Reply-To: <CALCETrWv87BS5hH20qKd7WGuf6EAEb4f78Myq+6fqXgSJWoiew@mail.gmail.com>
01.02.2016 21:28, Andy Lutomirski пишет:
> On Mon, Feb 1, 2016 at 10:16 AM, Stas Sergeev <stsp@list.ru> wrote:
>> 01.02.2016 21:04, Oleg Nesterov пишет:
>>> Yes, and SS_FORCE means "I know what I do", looks very simple.
>> But to me its not because I don't know what to do with
>> uc_stack after SS_FORCE is applied.
>>
>>> I won't argue, but to me it would be better to keep this EPERM if !force.
>>> Just because we should avoid the incompatible changes if possible.
>> Ok then. Lets implement SS_FORCE.
>> What semantic should it have wrt uc_stack?
>>
>> sigaltstack(SS_DISABLE | SS_FORCE);
>> swapcontext();
>> sigaltstack(set up new_sas);
>> rt_sigreturn();
>>
>> What's at the end? Do we want a surprise for the user
>> that he's new_sas got ignored?
> More detail please. What context are you returning to with
> rt_sigreturn? What's in uc_stack?
Whatever was saved there by save_altstack_ex() I guess.
Which is the sas params on signal entry.
And I am returning to the interrupted user context.
I am using SA_SIGINFO with sigaction().
This is actually what I was asking you already yeaterday.
I don't think SS_FORCE can play nicely with uc_stack and
you haven't clarified that part, so lets try again.
> Presumably we should continue to honor uc_stack in rt_sigreturn.
In this case, the above sigaltstack(set up new_sas) just
gets ignored. Are we allright with that? If so, I can code
up the patch. Whatever. :)
> I'm
> less clear on whether we should have an implicit SS_FORCE when
> restoring uc_stack.
This is obscure and is likely outside of the scope of the
problem at hands.
> I'm also not clear on why uc_stack exists in the
> first place.
>
> If I were designing this from scratch, I'd have signal delivery for an
> SA_ONSTACK signal save away the altstack information and clear it so
> that nested signals work without checking sp during signal delivery.
How would you then evaluate oss->ss_flags?
next prev parent reply other threads:[~2016-02-01 18:41 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-31 16:16 [PATCH 0/4] make sigaltstack() compatible with swapcontext() Stas Sergeev
2016-01-31 16:18 ` [PATCH 1/4] selftests: Add test for sigaltstack(SS_DISABLE) inside sighandler Stas Sergeev
2016-02-12 16:12 ` Shuah Khan
2016-02-12 16:17 ` Stas Sergeev
2016-01-31 16:21 ` [PATCH 2/4] score: signal: fix sigaltstack check Stas Sergeev
2016-02-02 19:07 ` Lennox Wu
2016-01-31 16:24 ` [PATCH 3/4] x86: signal: unify the sigaltstack check with other arches Stas Sergeev
2016-01-31 16:58 ` Andy Lutomirski
2016-01-31 18:03 ` Stas Sergeev
2016-01-31 16:28 ` [PATCH 4/4] sigaltstack: allow disabling and re-enabling sas within sighandler Stas Sergeev
2016-01-31 17:00 ` Andy Lutomirski
2016-01-31 17:33 ` Stas Sergeev
2016-01-31 19:03 ` Andy Lutomirski
2016-01-31 20:08 ` Stas Sergeev
2016-01-31 20:11 ` Andy Lutomirski
2016-01-31 22:36 ` Stas Sergeev
2016-01-31 22:44 ` Andy Lutomirski
2016-01-31 23:45 ` Stas Sergeev
2016-02-01 16:06 ` Oleg Nesterov
2016-02-01 16:57 ` Stas Sergeev
2016-02-01 17:27 ` Oleg Nesterov
2016-02-01 17:09 ` Oleg Nesterov
2016-02-01 17:26 ` Stas Sergeev
2016-02-01 18:04 ` Oleg Nesterov
2016-02-01 18:16 ` Stas Sergeev
2016-02-01 18:28 ` Andy Lutomirski
2016-02-01 18:40 ` Stas Sergeev [this message]
2016-02-01 18:52 ` Oleg Nesterov
2016-02-01 19:01 ` Stas Sergeev
2016-02-01 19:29 ` Oleg Nesterov
2016-02-01 19:46 ` Stas Sergeev
2016-02-01 20:41 ` Oleg Nesterov
2016-02-01 23:06 ` Stas Sergeev
2016-01-31 19:10 [PATCH v2 0/4] make sigaltstack() compatible with swapcontext() Stas Sergeev
2016-01-31 19:18 ` [PATCH 4/4] sigaltstack: allow disabling and re-enabling sas within sighandler Stas Sergeev
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=56AFA6B4.8030808@list.ru \
--to=stsp@list.ru \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=amanieu@gmail.com \
--cc=cyphar@cyphar.com \
--cc=ebiederm@xmission.com \
--cc=jason.low2@hp.com \
--cc=josh@joshtriplett.org \
--cc=khlebnikov@yandex-team.ru \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=palmer@dabbelt.com \
--cc=peterz@infradead.org \
--cc=pmoore@redhat.com \
--cc=richard@nod.at \
--cc=tj@kernel.org \
--cc=vdavydov@parallels.com \
--cc=xypron.glpk@gmx.de \
/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
Powered by JetHome