Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Apr 2011 07:45:08 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/net if.c
Message-ID:  <201104040745.p347jNSC062047@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
glebius     2011-04-04 07:45:08 UTC

  FreeBSD src repository

  Modified files:
    sys/net              if.c 
  Log:
  SVN rev 220317 on 2011-04-04 07:45:08Z by glebius
  
  When removing ifnets, we should first remove the reference to ifnet
  from the interface index, then decrease refcount, not vice versa.
  
  Otherwise there is a race (reproducible) when if_free_internal()
  contests on IFNET_WLOCK(), and we got a zero-refed ifnet in the
  index for a long time. It may be picked by some other thread,
  that runs ifnet_byindex_ref(), who takes the ifnet from index,
  and bumps refcount. When reader drops the lock, if_free_internal()
  proceeds with free. Then reader tries to free it a second time.
  
  Revision  Changes    Path
  1.399     +10 -9     src/sys/net/if.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104040745.p347jNSC062047>