git: kernel - Fix race in sys_shmmat()

Matthew Dillon dillon at crater.dragonflybsd.org
Sat Aug 17 11:54:30 PDT 2019


commit 6ec30377416a8c9e858217ebd051c288d093985a
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sat Aug 17 11:34:12 2019 -0700

    kernel - Fix race in sys_shmmat()
    
    * Fix a race whereby two threads can attempt to allocate the
      same shmmap_s.  The race can occur because blocking conditions
      interrupt the token interlock.
    
      Simply add a simple reserved field to stage the allocation
      prior to the shmid being assigned.

Summary of changes:
 sys/kern/sysv_shm.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6ec30377416a8c9e858217ebd051c288d093985a


-- 
DragonFly BSD source repository


More information about the Commits mailing list