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


Groups > linux.kernel > #1351194

Re: [PATCH v4 0/2] make sigaltstack() compatible with swapcontext()

From Stas Sergeev <stsp@list.ru>
Newsgroups linux.kernel
Subject Re: [PATCH v4 0/2] make sigaltstack() compatible with swapcontext()
Date 2016-03-06 21:30 +0100
Message-ID <r9Nto-1uz-3@gated-at.bofh.it> (permalink)
References <r7DHQ-8rB-15@gated-at.bofh.it> <r9Na2-1n4-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


06.03.2016 23:02, Szabolcs Nagy пишет:
> * Stas Sergeev <stsp@list.ru> [2016-03-01 00:29:03 +0300]:
>> The following patches make it possible to use swapcontext()
>> in a sighandler that works on sigaltstack.
> i don't think that's possible, the (obsolete) userspace
> *context functions cannot operate on kernel provided
> ucontext_t structs,
It doesn't have to.
It does the normal getcontext()/swapcontext() sequences,
as if it would be switching from any casual code place.
Kernel-provided context structs are completely irrelevant.
For more details please see the test-case I posted in that patch series.
It shows what can be done and how.

>   so they are not usable in signal
> handlers.
Please note the fact that swapcontext() also replaces the
signal mask as part of the context switching. This is a very
strong hint that it was intended to work with signal handlers.
And in fact it perfectly does.
What I want is only to make it friendly to sigaltstack.
I am not making it friendly to signal handlers in general,
because it already is.

> at least not on most target archs.
>
> so i don't understand how the tests can work portably.
If you apply my patch series, you can immediately test
it on any arch you want, thanks to the test-case my patch
adds to the kernel. Please let me know on what arch it fails.

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


Thread

Re: [PATCH v4 0/2] make sigaltstack() compatible with swapcontext() Szabolcs Nagy <nsz@port70.net> - 2016-03-06 21:10 +0100
  Re: [PATCH v4 0/2] make sigaltstack() compatible with swapcontext() Szabolcs Nagy <nsz@port70.net> - 2016-03-06 21:30 +0100
  Re: [PATCH v4 0/2] make sigaltstack() compatible with swapcontext() Stas Sergeev <stsp@list.ru> - 2016-03-06 21:30 +0100

csiph-web