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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 3, 2016 at 12:50 AM, tip-bot for Stas Sergeev
<tipbot@xxxxxxxxx> wrote:
> Commit-ID:  2a74213838104a41588d86fd5e8d344972891ace
> Gitweb:     http://git.kernel.org/tip/2a74213838104a41588d86fd5e8d344972891ace
> Author:     Stas Sergeev <stsp@xxxxxxx>
> AuthorDate: Thu, 14 Apr 2016 23:20:04 +0300
> Committer:  Ingo Molnar <mingo@xxxxxxxxxx>
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux