Failing autobuilds with a segfault in winbindd

Stefan Metzmacher metze at samba.org
Wed Oct 18 11:42:33 UTC 2017


Hi,

I think I found the problems.

Please review and push:-)

I'm also a bit nervous about an endless retry loop over 'goto again',
shouldn't we add some kind of retry check like we have in other places?

metze

Am 18.10.2017 um 13:06 schrieb Volker Lendecke:
> On Tue, Oct 17, 2017 at 04:12:33PM +1300, Andrew Bartlett via samba-technical wrote:
>> G'Day Volker,
>>
>> I've noticed two recent autobuild failures showing a segfault in winbindd.  
>>
>> They started only this week (I've checked back to the start of July)
>>
>> https://git.samba.org/autobuild.flakey.sn-devel-144/2017-10-12-1238/samba.stderr
>> https://git.samba.org/autobuild.flakey.sn-devel-144/2017-10-13-1240/samba.stderr
>> https://git.samba.org/autobuild.flakey.sn-devel-144/2017-10-16-2110/samba.stderr
>>
>> Giving that the failure is in operating on a netlogon pipe and the
>> recent changes that I reviewed for you to the winbind code, 
>> I wondered if you would might be able to look into this to see if you
>> can work out what is going wrong?
> 
> Stared at the code, but I didn't find any code path where we would
> leave cli->binding_handle uninitialized. It seems that in all three
> instances "h" is 500000000000401, which sounds like a memory
> corruption that might come from anywhere. Is there a way we can run
> the flaky check (or a private autobuild) with winbind under valgrind? 
> 
> Volker
> 

-------------- next part --------------
From 6e5a06f30de788f17942ad6e675e9550177fb2bd Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Oct 2017 13:36:59 +0200
Subject: [PATCH] s3:cli_netlogon: make sure rpccli_connect_netlogon only
 returns NT_STATUS_OK on success in

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/rpc_client/cli_netlogon.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 19b81a5..f2454ef 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -354,15 +354,16 @@ again:
 		status = cli_rpc_pipe_open_bind_schannel(
 			cli, &ndr_table_netlogon, transport, creds_ctx,
 			&rpccli);
-		if (!NT_STATUS_IS_OK(status)) {
-			DBG_DEBUG("cli_rpc_pipe_open_bind_schannel "
-				  "failed: %s\n", nt_errstr(status));
-		}
 		if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
 			DBG_DEBUG("Retrying with serverauthenticate\n");
 			TALLOC_FREE(lck);
 			goto again;
 		}
+		if (!NT_STATUS_IS_OK(status)) {
+			DBG_DEBUG("cli_rpc_pipe_open_bind_schannel "
+				  "failed: %s\n", nt_errstr(status));
+			goto fail;
+		}
 		goto done;
 	}
 
@@ -399,6 +400,7 @@ again:
 		if (!NT_STATUS_IS_OK(status)) {
 			DBG_DEBUG("cli_rpc_pipe_open_noauth_transport "
 				  "failed: %s\n", nt_errstr(status));
+			goto fail;
 		}
 		goto done;
 	}
@@ -434,6 +436,7 @@ again:
 		if (!NT_STATUS_IS_OK(status)) {
 			DBG_DEBUG("cli_rpc_pipe_open_noauth_transport "
 				  "failed: %s\n", nt_errstr(status));
+			goto fail;
 		}
 		goto done;
 	}
-- 
1.9.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20171018/c3ecf6a5/signature.sig>


More information about the samba-technical mailing list