diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-06-20 17:38:19 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-06-20 17:38:19 +0000 |
commit | 1183f24cdee8e86902d84beeb71a40dfd639821f (patch) | |
tree | 9c4648763cdd9f30d44ce467c68daa7419c41300 /sys/kern/uipc_socket.c | |
parent | c2c08bfea9f0b67e5dc6d1bfb4965653311fefe3 (diff) | |
download | FreeBSD-src-1183f24cdee8e86902d84beeb71a40dfd639821f.zip FreeBSD-src-1183f24cdee8e86902d84beeb71a40dfd639821f.tar.gz |
Annotate some ordering-related issues in solisten() which are not yet
resolved by socket locking: in particular, that we test the connection
state at the socket layer without locking, request that the protocol
begin listening, and then set the listen state on the socket
non-atomically, resulting in a non-atomic cross-layer test-and-set.
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 5d5d1e3..1dd503c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -265,6 +265,11 @@ solisten(so, backlog, td) { int s, error; + /* + * XXXRW: Ordering issue here -- perhaps we need to set + * SO_ACCEPTCONN before the call to pru_listen()? + * XXXRW: General atomic test-and-set concerns here also. + */ s = splnet(); if (so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) { |