linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@list.ru>
To: stsp@list.ru
Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
	Andy Lutomirski <luto@amacapital.net>,
	Oleg Nesterov <oleg@redhat.com>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: [PATCH v6(resend2) 0/4] make sigaltstack compatible with swapcontext()
Date: Thu, 14 Apr 2016 23:20:01 +0300	[thread overview]
Message-ID: <1460665206-13646-1-git-send-email-stsp@list.ru> (raw)

The following patches make it possible to use swapcontext()
in a sighandler that works on sigaltstack.
The approach is inspired by Andy Lutomirski's suggestion that
sigaltstack should disarm itself after saving into uc_stack:
https://lkml.org/lkml/2016/2/1/594

I add the SS_AUTODISARM flag that does exactly that.
On sighandler exit, the sigaltstack is restored from uc_stack.
Another possible name could be SS_ONESHOT, but, since it gets
always re-enabled, I choose SS_AUTODISARM.

Changes since previous resend:
- Added missing CCs, thanks for the hint Ingo

Change since v5:
- Fix description of patch 4/4

Change since v4:
- Implement this Andy Lutomirski's suggestion:
https://lkml.org/lkml/2016/3/6/158
that allows the run-time probing of the existence of the
flags added in the future.

[PATCH 1/4] [Cleanup] x86: signal: unify the sigaltstack check with
	A clean-up patch that unifies x86's sigaltstack handling with
	other arches.
[PATCH 2/4] sigaltstack: preparations for adding new SS_xxx flags
	Andy's suggested changes
[PATCH 3/4] sigaltstack: implement SS_AUTODISARM flag
	This patch implements SS_AUTODISARM flag
[PATCH 4/4] selftests: Add test for
	This patch adds the selftest code for new functionality

CC: linux-kernel@vger.kernel.org
CC: linux-api@vger.kernel.org
CC: Andy Lutomirski <luto@amacapital.net>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Shuah Khan <shuahkh@osg.samsung.com>
CC: Ingo Molnar <mingo@redhat.com>

Diffstat:
 arch/x86/kernel/signal.c                     |   23 +--
 include/linux/sched.h                        |    8 +
 include/linux/signal.h                       |    4 
 include/uapi/linux/signal.h                  |    7 +
 kernel/fork.c                                |    2 
 kernel/signal.c                              |   26 ++--
 tools/testing/selftests/Makefile             |    1 
 tools/testing/selftests/sigaltstack/Makefile |    8 +
 tools/testing/selftests/sigaltstack/sas.c    |  156 +++++++++++++++++++++++++++
 9 files changed, 208 insertions(+), 27 deletions(-)

             reply	other threads:[~2016-04-14 20:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 20:20 Stas Sergeev [this message]
2016-04-14 20:20 ` [PATCH 1/4] [Cleanup] x86: signal: unify the sigaltstack check with other arches Stas Sergeev
2016-05-03  7:49   ` [tip:core/signals] signals/sigaltstack, x86/signals: Unify the x86 sigaltstack check with other architectures tip-bot for Stas Sergeev
2016-05-03 16:12     ` Andy Lutomirski
2016-04-14 20:20 ` [PATCH 2/4] sigaltstack: preparations for adding new SS_xxx flags Stas Sergeev
2016-05-03  7:50   ` [tip:core/signals] signals/sigaltstack: Prepare to add " tip-bot for Stas Sergeev
2016-05-03  9:59     ` Borislav Petkov
2016-05-03 16:13     ` Andy Lutomirski
2016-05-03 16:44       ` Andy Lutomirski
2016-04-14 20:20 ` [PATCH 3/4] sigaltstack: implement SS_AUTODISARM flag Stas Sergeev
2016-05-03  7:50   ` [tip:core/signals] signals/sigaltstack: Implement " tip-bot for Stas Sergeev
2016-05-03 16:27     ` Andy Lutomirski
2016-04-14 20:20 ` [PATCH 4/4] selftests: Add test for sigaltstack(SS_ONSTACK|SS_AUTODISARM) Stas Sergeev
2016-05-03  7:50   ` [tip:core/signals] selftests/sigaltstack: Add new testcase " tip-bot for Stas Sergeev
2016-05-03 16:43     ` 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=1460665206-13646-1-git-send-email-stsp@list.ru \
    --to=stsp@list.ru \
    --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=shuahkh@osg.samsung.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;
as well as URLs for NNTP newsgroup(s).