DragonFly BSD
DragonFly commits List (threaded) for 2011-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: DragonFly_RELEASE_2_10 AF_UNIX: Hold a reference of the unp_conn before executing blocking code


From: Venkatesh Srinivas <vsrinivas@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 6 Jun 2011 19:09:59 -0700 (PDT)

commit 1057aec6d468e5aa0764ff6025053ea52287abba
Author: Sepherosa Ziehau <sephe@dragonflybsd.org>
Date:   Wed Apr 27 15:10:03 2011 +0800

    AF_UNIX: Hold a reference of the unp_conn before executing blocking code
    
    Since unp_token will be automaticly released upon execution of blocking
    code, close of unp_conn could race any code paths that references unp_conn
    after executing blocking code.  To fix these races, we simply increment
    the reference count of the unp_conn before executig any possibly blocking
    code and release the reference count of unp_conn, which may release unp_conn
    itself.  This _currently_ does not suffer 0-ref race, since unp_token is
    always being held.

Summary of changes:
 sys/kern/uipc_usrreq.c |   77 ++++++++++++++++++++++++++++++++++++++++-------
 sys/sys/unpcb.h        |    2 +-
 2 files changed, 66 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1057aec6d468e5aa0764ff6025053ea52287abba


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]