linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] make sigaltstack() compatible with swapcontext()
@ 2016-01-31 16:16 Stas Sergeev
  2016-01-31 16:18 ` [PATCH 1/4] selftests: Add test for sigaltstack(SS_DISABLE) inside sighandler Stas Sergeev
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Stas Sergeev @ 2016-01-31 16:16 UTC (permalink / raw)
  To: Linux kernel; +Cc: linux-api, Andy Lutomirski

The following patches add the self-test for
sigaltstack(SS_DISABLE) inside the signal handler,
and allow an app to temporarily disable and re-enable
the sigaltstack within a sighandler.
This is needed to make sigaltstack() compatible with
swapcontext(): before using swapcontext() inside
the sighandler, the sigaltstack should be disabled, or
the stack will be corrupted by the subsequent signals.



  arch/score/kernel/signal.c                   |    2
  arch/x86/kernel/signal.c                     |    2
  include/linux/sched.h                        |    8 +
  include/linux/signal.h                       |    2
  kernel/fork.c                                |    4
  kernel/signal.c                              |   54 +++++++----
  tools/testing/selftests/Makefile             |    1
  tools/testing/selftests/sigaltstack/Makefile |    8 +
  tools/testing/selftests/sigaltstack/sas.c    |  132 
+++++++++++++++++++++++++++
  9 files changed, 189 insertions(+), 24 deletions(-)

^ permalink raw reply	[flat|nested] 34+ messages in thread
* [PATCH v2 0/4] make sigaltstack() compatible with swapcontext()
@ 2016-01-31 19:10 Stas Sergeev
  2016-01-31 19:18 ` [PATCH 4/4] sigaltstack: allow disabling and re-enabling sas within sighandler Stas Sergeev
  0 siblings, 1 reply; 34+ messages in thread
From: Stas Sergeev @ 2016-01-31 19:10 UTC (permalink / raw)
  To: Linux kernel; +Cc: linux-api, Andy Lutomirski

The following patches add the self-test for
sigaltstack(SS_DISABLE) inside the signal handler,
and allow an app to temporarily disable and re-enable
the sigaltstack within a sighandler.
This is needed to make sigaltstack() compatible with
swapcontext(): before using swapcontext() inside
the sighandler, the sigaltstack should be disabled, or
the stack will be corrupted by the subsequent signals.


v2: avoid duplicating the "!sigstack" check in get_sigframe()
as requested by Andy Lutomirski.



  arch/score/kernel/signal.c                   |    2
  arch/x86/kernel/signal.c                     |    2
  include/linux/sched.h                        |    8 +
  include/linux/signal.h                       |    2
  kernel/fork.c                                |    4
  kernel/signal.c                              |   54 +++++++----
  tools/testing/selftests/Makefile             |    1
  tools/testing/selftests/sigaltstack/Makefile |    8 +
  tools/testing/selftests/sigaltstack/sas.c    |  132 
+++++++++++++++++++++++++++
  9 files changed, 189 insertions(+), 24 deletions(-)

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

end of thread, other threads:[~2016-02-12 16:17 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
  -- strict thread matches above, loose matches on Subject: below --
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

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