[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dragonfly-commits
Subject:    git: libc - Check for invalid context in setcontext() and swapcontext()
From:       Matthew Dillon <dillon () crater ! dragonflybsd ! org>
Date:       2020-01-25 23:47:22
Message-ID: 20200125234722.E8BD590BE57 () crater ! dragonflybsd ! org
[Download RAW message or body]


commit c27d72478c10a7d8648217bc817f8429939e8828
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Sat Jan 25 15:44:57 2020 -0800

    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

Summary of changes:
 lib/libc/gen/ucontext.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c27d72478c10a7d8648217bc817f8429939e8828


-- 
DragonFly BSD source repository
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic