linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] make sigaltstack() compatible with swapcontext()
@ 2016-02-28 21:13 Stas Sergeev
       [not found] ` <1456694000-16395-1-git-send-email-stsp-cmBhpYW9OiY@public.gmane.org>
  2016-02-28 21:13 ` [PATCH 2/2] selftests: Add test for sigaltstack(SS_AUTODISARM) Stas Sergeev
  0 siblings, 2 replies; 12+ messages in thread
From: Stas Sergeev @ 2016-02-28 21:13 UTC (permalink / raw)
  To: stsp; +Cc: linux-kernel, linux-api

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.

[PATCH 1/2] sigaltstack: implement SS_AUTODISARM flag
	This patch implements SS_AUTODISARM flag
[PATCH 2/2] selftests: Add test for sigaltstack(SS_AUTODISARM)
	This patch adds the selftest code for new functionality

CC: linux-kernel@vger.kernel.org
CC: linux-api@vger.kernel.org

Diffstat:
 include/linux/sched.h                        |    1 
 include/linux/signal.h                       |    4 
 include/uapi/linux/signal.h                  |    3 
 kernel/fork.c                                |    4 
 kernel/signal.c                              |   23 ++--
 tools/testing/selftests/Makefile             |    1 
 tools/testing/selftests/sigaltstack/Makefile |    8 +
 tools/testing/selftests/sigaltstack/sas.c    |  151 +++++++++++++++++++++++++++
 8 files changed, 182 insertions(+), 13 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH v4 0/2] make sigaltstack() compatible with swapcontext()
@ 2016-02-29 21:29 Stas Sergeev
  2016-02-29 21:29 ` [PATCH 1/2] sigaltstack: implement SS_AUTODISARM flag Stas Sergeev
  0 siblings, 1 reply; 12+ messages in thread
From: Stas Sergeev @ 2016-02-29 21:29 UTC (permalink / raw)
  To: stsp-cmBhpYW9OiY
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA, Andy Lutomirski, Oleg Nesterov,
	Shuah Khan

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.

[PATCH 1/2] sigaltstack: implement SS_AUTODISARM flag
	This patch implements SS_AUTODISARM flag
[PATCH 2/2] selftests: Add test for sigaltstack(SS_AUTODISARM)
	This patch adds the selftest code for new functionality

CC: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
CC: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
CC: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
CC: Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
CC: Shuah Khan <shuahkh-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>

Diffstat:
 include/linux/sched.h                        |    8 +
 include/linux/signal.h                       |    4 
 include/uapi/linux/signal.h                  |    3 
 kernel/fork.c                                |    2 
 kernel/signal.c                              |   23 ++--
 tools/testing/selftests/Makefile             |    1 
 tools/testing/selftests/sigaltstack/Makefile |    8 +
 tools/testing/selftests/sigaltstack/sas.c    |  151 +++++++++++++++++++++++++++
 8 files changed, 187 insertions(+), 13 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-03-06 20:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-28 21:13 [PATCH v3 0/2] make sigaltstack() compatible with swapcontext() Stas Sergeev
     [not found] ` <1456694000-16395-1-git-send-email-stsp-cmBhpYW9OiY@public.gmane.org>
2016-02-28 21:13   ` [PATCH 1/2] sigaltstack: implement SS_AUTODISARM flag Stas Sergeev
     [not found]     ` <1456694000-16395-2-git-send-email-stsp-cmBhpYW9OiY@public.gmane.org>
2016-02-29  6:29       ` Stas Sergeev
2016-02-28 21:13 ` [PATCH 2/2] selftests: Add test for sigaltstack(SS_AUTODISARM) Stas Sergeev
  -- strict thread matches above, loose matches on Subject: below --
2016-02-29 21:29 [PATCH v4 0/2] make sigaltstack() compatible with swapcontext() Stas Sergeev
2016-02-29 21:29 ` [PATCH 1/2] sigaltstack: implement SS_AUTODISARM flag Stas Sergeev
     [not found]   ` <1456781345-8243-2-git-send-email-stsp-cmBhpYW9OiY@public.gmane.org>
2016-03-04 22:22     ` Andy Lutomirski
     [not found]       ` <CALCETrWMJ-2xovNnPgsKZtmBWZpqBERCTzne2L81x0tcm0BhbQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-05  7:39         ` Stas Sergeev
     [not found]           ` <56DA8D25.20600-cmBhpYW9OiY@public.gmane.org>
2016-03-05  7:40             ` Stas Sergeev
2016-03-06 20:07     ` Andy Lutomirski
     [not found]       ` <CALCETrVhtHdiS_W3WuCi1bTH78uoTSCHW2MN9hA36=h56-A3oA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-06 20:10         ` Andy Lutomirski
     [not found]           ` <CALCETrW=M1=n6R6dwOj-ks_=+14vf4rz0S3SFty-_GuwFFZU5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-06 20:17             ` Stas Sergeev
     [not found]               ` <56DC904C.2060708-cmBhpYW9OiY@public.gmane.org>
2016-03-06 20:55                 ` Andy Lutomirski

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).