diff options
author | glebius <glebius@FreeBSD.org> | 2011-04-04 07:45:08 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2011-04-04 07:45:08 +0000 |
commit | 8c3b1b83f91d3ae32e57985dc139f3728564c2f5 (patch) | |
tree | 6ab7d9d922cc6d5c8f4554b032a000102622d5b1 /lib/libdevstat/devstat.c | |
parent | 44e946c1dd34a24a0c9d74ba5420fac22fa3f693 (diff) | |
download | FreeBSD-src-8c3b1b83f91d3ae32e57985dc139f3728564c2f5.zip FreeBSD-src-8c3b1b83f91d3ae32e57985dc139f3728564c2f5.tar.gz |
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.
Diffstat (limited to 'lib/libdevstat/devstat.c')
0 files changed, 0 insertions, 0 deletions