git: bridge - Fix dereference race

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Mar 28 15:10:42 PDT 2018


commit e41e076d091fb90698359ac301f3d37cfb13fdf9
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Mar 28 15:09:18 2018 -0700

    bridge - Fix dereference race
    
    * bri->bri_dead can be set asynchronously vs gc scans, catching a
      scan in the middle.
    
    * Add a ref count, bri_refs, to be able to properly determine when
      we can kfree() the bri.  Before we kfree()'d it in the last chained
      netisr, but that had the above race.

Summary of changes:
 sys/net/bridge/if_bridge.c    | 21 ++++++++++++++++-----
 sys/net/bridge/if_bridgevar.h |  1 +
 2 files changed, 17 insertions(+), 5 deletions(-)

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


-- 
DragonFly BSD source repository



More information about the Commits mailing list