From 1183f24cdee8e86902d84beeb71a40dfd639821f Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 20 Jun 2004 17:38:19 +0000 Subject: [PATCH] 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. --- sys/kern/uipc_socket.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 5d5d1e36f703..1dd503c9bace 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)) {