NetBSD-Bugs archive

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

kern/43694: fd_getfile / fd_alloc race

>Number:         43694
>Category:       kern
>Synopsis:       fd_getfile / fd_alloc race
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 02 10:25:00 +0000 2010
>Originator:     Antti Kantee
fd_getfile() ups the fdfile's refcnt, checks for ff_file and if NULL
lowers the refcnt and returns fail.  Meanwhile, fd_alloc selects
a free file descriptor and KASSERTs that the refcount is 0.
run tests/kernel/t_filedesc -v iters=10000000 getfilerace
Maybe the kassert is wrong.  But I didn't fully think through how
application threads need to synchronize fd usage to be race-free.

Home | Main Index | Thread Index | Old Index