[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-1054-gbfeab3a

Volker Lendecke vlendec at samba.org
Sun May 24 18:49:59 GMT 2009

The branch, v3-4-test has been updated
       via  bfeab3a0f621dbea50f43c98ba70b0ccd8323bff (commit)
      from  689664ad7acf13b07409abd4c2820dbe10255b68 (commit)


- Log -----------------------------------------------------------------
commit bfeab3a0f621dbea50f43c98ba70b0ccd8323bff
Author: Volker Lendecke <vl at samba.org>
Date:   Sun May 24 18:57:13 2009 +0200

    Fix a race condition in winbind leading to a panic
    In winbind, we do multiple events in one select round. This needs fixing, but
    as long as we're still using it, for efficiency reasons we need to do that.
    What can happen is the following: We have outgoing data pending for a client,
    	state->fd_event.flags == EVENT_FD_WRITE
    Now a new client comes in, we go through the list of clients to find an idle
    one. The detection for idle clients in remove_idle_client does not take the
    pending data into account. We close the socket that has pending outgoing data,
    the accept(2) one syscall later gives us the same socket.
    In new_connection(), we do a setup_async_read, setting up a read fde. The
    select from before however had found the socket (that we had already closed!!)
    to be writable. In rw_callback we only want to see a readable flag, and we
    panic in the SMB_ASSERT(flags == EVENT_FD_READ).
    Found using
    bin/smbtorture // -U% -N 500 -o 2 local-wbclient


Summary of changes:
 source3/winbindd/winbindd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 6627106..7b7980c 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -908,6 +908,7 @@ static bool remove_idle_client(void)
 	for (state = winbindd_client_list(); state; state = state->next) {
 		if (state->response.result != WINBINDD_PENDING &&
+		    state->fd_event.flags == EVENT_FD_READ &&
 		    !state->getpwent_state && !state->getgrent_state) {
 			if (!last_access || state->last_access < last_access) {

Samba Shared Repository

More information about the samba-cvs mailing list