git: bridge - Fix dereference race

Matthew Dillon dillon at
Wed Mar 28 15:10:42 PDT 2018

commit e41e076d091fb90698359ac301f3d37cfb13fdf9
Author: Matthew Dillon <dillon at>
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(-)

DragonFly BSD source repository

More information about the Commits mailing list