Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1393594

Re: [tip:core/signals] signals/sigaltstack: Implement SS_AUTODISARM flag

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [tip:core/signals] signals/sigaltstack: Implement SS_AUTODISARM flag
Date 2016-05-03 18:30 +0200
Message-ID <ruLmV-2Uv-1@gated-at.bofh.it> (permalink)
References <rnW3M-7VI-13@gated-at.bofh.it> <ruDpo-3Rg-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 3, 2016 at 12:50 AM, tip-bot for Stas Sergeev
<tipbot@zytor.com> wrote:
> Commit-ID:  2a74213838104a41588d86fd5e8d344972891ace
> Gitweb:     http://git.kernel.org/tip/2a74213838104a41588d86fd5e8d344972891ace
> Author:     Stas Sergeev <stsp@list.ru>
> AuthorDate: Thu, 14 Apr 2016 23:20:04 +0300
> Committer:  Ingo Molnar <mingo@kernel.org>
> CommitDate: Tue, 3 May 2016 08:37:59 +0200
>
> signals/sigaltstack: Implement SS_AUTODISARM flag
>
> This patch implements the SS_AUTODISARM flag that can be OR-ed with
> SS_ONSTACK when forming ss_flags.
>
> When this flag is set, sigaltstack will be disabled when entering
> the signal handler; more precisely, after saving sas to uc_stack.
> When leaving the signal handler, the sigaltstack is restored by
> uc_stack.
>
> When this flag is used, it is safe to switch from sighandler with
> swapcontext(). Without this flag, the subsequent signal will corrupt
> the state of the switched-away sighandler.
>
> To detect the support of this functionality, one can do:
>
>   err = sigaltstack(SS_DISABLE | SS_AUTODISARM);
>   if (err && errno == EINVAL)
>         unsupported();

One of my review comments from last time got lost, I think.  I'll send
a followup patch.

> +/* bit-flags */
> +#define SS_AUTODISARM  (1 << 4)        /* disable sas during sighandling */

Before this gets enshrined as ABI, could we perhaps change this to (1
<< 31)?  I don't see why we should pick a bit in the middle of the
field as our first flag bit.

--Andy

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[tip:core/signals] signals/sigaltstack: Implement SS_AUTODISARM  flag tip-bot for Stas Sergeev <tipbot@zytor.com> - 2016-05-03 10:00 +0200
  Re: [tip:core/signals] signals/sigaltstack: Implement SS_AUTODISARM flag Andy Lutomirski <luto@amacapital.net> - 2016-05-03 18:30 +0200

csiph-web