History log of /dflybsd-src/lib/libc/gen/ucontext.c (Results 1 – 12 of 12)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.4.0, v6.4.0rc1, v6.5.0, v6.2.2, v6.2.1, v6.3.0, v6.0.1, v6.0.0, v6.0.0rc1, v6.1.0, v5.8.3, v5.8.2, v5.8.1, v5.8.0, v5.9.0, v5.8.0rc1, v5.6.3
# c27d7247 25-Jan-2020 Matthew Dillon <dillon@apollo.backplane.com>

libc - Check for invalid context in setcontext() and swapcontext()

* Check for an invalid context in setcontext() and swapcontext()
and return -1 instead of switching to the invalid context.

* Th

libc - Check for invalid context in setcontext() and swapcontext()

* Check for an invalid context in setcontext() and swapcontext()
and return -1 instead of switching to the invalid context.

* This is not an exhaustive check but will handle invalid states set
by makecontext() if e.g. argc is messed up or the supplied stack is
too small. In particular, if makecontext() fails and set/swap tries
to switch to it, it will switch to the state from the getcontext()
prior to the makecontext() instead of to the desired makecontext()
state.

Reported-by: zrj, tuxillo

show more ...


Revision tags: v5.6.2, v5.6.1, v5.6.0, v5.6.0rc1, v5.7.0, v5.4.3, v5.4.2
# a32e3ba6 08-Apr-2019 Sascha Wildner <saw@online.de>

libc: Add prototypes for various functions we use in __weak_reference().


Revision tags: v5.4.1, v5.4.0, v5.5.0, v5.4.0rc1, v5.2.2, v5.2.1, v5.2.0, v5.3.0, v5.2.0rc, v5.0.2, v5.0.1, v5.0.0, v5.0.0rc2, v5.1.0, v5.0.0rc1, v4.8.1, v4.8.0, v4.6.2, v4.9.0, v4.8.0rc, v4.6.1
# f8406b33 06-Oct-2016 zrj <rimvydas.jasinskas@gmail.com>

<sys/cdefs.h>: Rework __weak_reference() macro.

My LTO build blew away weak symbols from slim LTO objects.
Use __strong_reference() + weak attribute to allow the compiler to catch
extern declaration

<sys/cdefs.h>: Rework __weak_reference() macro.

My LTO build blew away weak symbols from slim LTO objects.
Use __strong_reference() + weak attribute to allow the compiler to catch
extern declarations and not to fold weak symbols as local ones.

Keep previous version as __weak_reference_asm() in _pthread_stubs.c for
now due to several issues (there is a need to do it in a cleaner way).

lib/libc/gen/ucontext.c:
add missing __DECONST for ucp, shouldn't sigreturn take const ucontext_t?

lib/libc/inet/inet_ntoa.c:
add missing #undef inet_ntoa_r

No symbol changes in libc and librt on normal compilation.

While there, add __weak_symbol attribute for future additions.

show more ...


Revision tags: v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0, v4.4.3, v4.4.2
# 819d0c16 21-Dec-2015 Matthew Dillon <dillon@apollo.backplane.com>

libc - Add quick version for the context management functions.

* Add makecontext_quick(), setcontext_quick(), and swapcontext_quick().
These functions work similarly to the non-quick versions but

libc - Add quick version for the context management functions.

* Add makecontext_quick(), setcontext_quick(), and swapcontext_quick().
These functions work similarly to the non-quick versions but are designed
for fast synchronous switching. These functions do not mess with the
signal mask or stack at all and do not save or restore scratch registers.

* These functions make no system calls. Switching time can be as low as
~5 nanoseconds.

* These functions also provide optimizations for coroutine fall-through
linkages.

* Note that the coroutine / start-function callback arguments are somewhat
different. Start functions are called back as cofunc(ucp, arg). Var-args
are not supported and the stack is minimally aligned and initialized.

* Remove the old internal set_mcontext() and get_mcontext() routines.

show more ...


# 63261abb 21-Dec-2015 Matthew Dillon <dillon@apollo.backplane.com>

libc - Fix bugs in getcontext(), setcontext(), and swapcontext()

* Fix multiple bugs revealed by qemu's use of these functions. Most of
these fixes are accomplished by calling sigreturn(uctx) to

libc - Fix bugs in getcontext(), setcontext(), and swapcontext()

* Fix multiple bugs revealed by qemu's use of these functions. Most of
these fixes are accomplished by calling sigreturn(uctx) to restore the
state instead of trying to roll our own in userland. This won't be much
slower (if at all) because we had to save and restore the signal state
in the userland code anyway, so we could not avoid making at least one
system call.

Using sigreturn() handles the signal mask atomicy for us so we don't have
to deal with it and fixes numerous other issues. Along with this change,
adjust getcontext() and makecontext() to fill out additional important
fields in the ucontext that sigreturn() inspects.

* Fixes two stack corruption bugs. First, getcontext() was calling
get_mcontext() and get_mcontext() was setting up the setcontext return
state to return 1 ... from get_mcontext(), NOT from getcontext(). If
normal operations or signals mess with the stack, the double return
will not work. Oops.

Secondly, getcontext scribbled over the red-zone in a way that is not
permitted.

* setcontext() was restoring the context as saved by makecontext() or
getcontext(), but setcontext() can also be called with the ucontext
from the signal handler which requires a full restore. setcontext()
was not restoring FPU or scratch registers or rflags.

* Fixes signal restoration bug and corruption that can mess up emulation
in qemu.

* Fixes issues with qemu related to SMP startup and lack of preemption.

Reported-by: ivadasz

show more ...


Revision tags: v4.4.1, v4.4.0, v4.5.0, v4.4.0rc, v4.2.4, v4.3.1, v4.2.3, v4.2.1, v4.2.0, v4.0.6, v4.3.0, v4.2.0rc, v4.0.5, v4.0.4, v4.0.3, v4.0.2, v4.0.1, v4.0.0, v4.0.0rc3, v4.0.0rc2, v4.0.0rc, v4.1.0, v3.8.2, v3.8.1, v3.6.3, v3.8.0, v3.8.0rc2, v3.9.0, v3.8.0rc, v3.6.2, v3.6.1, v3.6.0, v3.7.1, v3.6.0rc, v3.4.3, v3.4.2, v3.4.1, v3.4.0, v3.4.0rc, v3.5.0, v3.2.2, v3.2.1, v3.2.0, v3.3.0, v3.0.3
# 890ced9f 20-Apr-2012 Matthew Dillon <dillon@apollo.backplane.com>

Merge branches 'hammer2' and 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into hammer2


# 6f93d55f 14-Apr-2012 Sascha Wildner <saw@online.de>

Remove some unnecessary inclusions of <sys/cdefs.h> across the tree.


Revision tags: v3.0.2, v3.0.1, v3.1.0, v3.0.0
# 86d7f5d3 26-Nov-2011 John Marino <draco@marino.st>

Initial import of binutils 2.22 on the new vendor branch

Future versions of binutils will also reside on this branch rather
than continuing to create new binutils branches for each new version.


Revision tags: v2.12.0, v2.13.0, v2.10.1, v2.11.0, v2.10.0, v2.9.1, v2.8.2, v2.8.1, v2.8.0, v2.9.0, v2.6.3, v2.7.3, v2.6.2, v2.7.2, v2.7.1, v2.6.1, v2.7.0, v2.6.0, v2.5.1, v2.4.1, v2.5.0, v2.4.0, v2.3.2, v2.3.1, v2.2.1, v2.2.0, v2.3.0, v2.1.1, v2.0.1
# e2742650 16-Jan-2007 Matthew Dillon <dillon@dragonflybsd.org>

Implement getcontext(), setcontext(), makecontext(), and swapcontext().

This is a preliminary libc-only implementation. sigprocmask() is used
to mask signals during the context switch and to save a

Implement getcontext(), setcontext(), makecontext(), and swapcontext().

This is a preliminary libc-only implementation. sigprocmask() is used
to mask signals during the context switch and to save and restore signals.
FP registers are not currently saved or restored - that is, synchronous
use is intended.

Submitted-by: "Matt Emmerton" <matt@gsicomp.on.ca>
Finished-up-by: "Matthew Dillon" <dillon@backplane.com>

show more ...


# 2443e96e 07-Feb-2011 Justin C. Sherrill <justin@leaf.dragonflybsd.org>

Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

Conflicts:
UPDATING


# 1c1822af 27-Jan-2011 Joe Talbott <josepht@zinc.oss.ntelos.net>

Merge branch 'master' of git://git.theshell.com/dragonfly


# e2b7bcae 17-Jan-2011 Sascha Wildner <saw@online.de>

libc: Fix warnings fallout from the change to CSTD=gnu99.