diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-02-11 13:44:27 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-02-11 13:44:27 +0000 |
commit | 67e0c1a7505996ee05c0b9efe0b6cea95d82d244 (patch) | |
tree | fb00e41a994d95a66b51d17a39d1d5442c4181ec /sys/dev/ppbus/lpt.c | |
parent | e1484b460d583e3aa74247fc1d27b269548bd9e2 (diff) | |
download | FreeBSD-src-67e0c1a7505996ee05c0b9efe0b6cea95d82d244.zip FreeBSD-src-67e0c1a7505996ee05c0b9efe0b6cea95d82d244.tar.gz |
Add a regresion test to determine whether or not a file descriptor is
allocated in a fork(2)-inheritable way at the beginning or end of an
accept(2) system call. This test creates a test thread and blocks it
in accept(2), then forks a child process which tests to see if the
next available file descriptor is defined or not (EBADF vs EINVAL for
ftruncate(2)).
This detects a regression introduced during the network stack locking
work, in which a very narrow race during which fork(2) from one
thread during accept(2) in a second thread lead to an extra inherited
file descriptor turned into a very wide race ensuring that a
descriptor was leaked into the child even though it hadn't been
returned.
PR: kern/130348
Diffstat (limited to 'sys/dev/ppbus/lpt.c')
0 files changed, 0 insertions, 0 deletions