The Samba-Bugzilla – Attachment 18953 Details for
Bug 15973
smbpasswd can crash winbindd on an AD DC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Patch for v4-24-test
bfixes-tmp424.txt (text/plain), 5.68 KB, created by
Stefan Metzmacher
on 2026-04-28 13:11:35 UTC
(
hide
)
Description:
Patch for v4-24-test
Filename:
MIME Type:
Creator:
Stefan Metzmacher
Created:
2026-04-28 13:11:35 UTC
Size:
5.68 KB
patch
obsolete
>From 61f1050c5dd85fa13e023a6197670ec62428352f Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Mon, 27 Apr 2026 18:14:18 +0200 >Subject: [PATCH 1/3] s3:winbindd: let init_dc_connection_rpc() fail if > domain->dcname is still NULL > >This can happen on a DC itself trying to talk to itself, >which is currently not expected. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15973 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Volker Lendecke <vl@samba.org> >(cherry picked from commit 38a9910ac99a015a3dac76b93f02d16e140c05e6) >--- > source3/winbindd/winbindd_cm.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c >index e49c72dc3321..8e0ce4070ad7 100644 >--- a/source3/winbindd/winbindd_cm.c >+++ b/source3/winbindd/winbindd_cm.c >@@ -1977,6 +1977,15 @@ static NTSTATUS init_dc_connection_rpc(struct winbindd_domain *domain, bool need > return NT_STATUS_TRUSTED_DOMAIN_FAILURE; > } > >+ if (domain->dcname == NULL) { >+ /* >+ * This can happen on a DC itself trying to talk to itself, >+ * which is currently not expected. >+ */ >+ DBG_WARNING("no dcname for domain %s\n", domain->name); >+ return NT_STATUS_NO_LOGON_SERVERS; >+ } >+ > return NT_STATUS_OK; > } > >-- >2.43.0 > > >From 1893e43e3f2c8811c97d4ad364b79667f74cab6e Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Mon, 27 Apr 2026 18:31:55 +0200 >Subject: [PATCH 2/3] s3:winbindd: replace > smbXcli_conn_remote_{name,sockaddr}() with domain->{dcname,dcaddr} > >domain->conn.cli might be NULL, so we should not deference it. > >init_dc_connection_rpc() already checks that domain->dcname is not >NULL... > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15973 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Volker Lendecke <vl@samba.org> >(cherry picked from commit 34c4ab4c610960ba587659e077608778970363a0) >--- > source3/winbindd/winbindd_cm.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > >diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c >index 8e0ce4070ad7..e3018e16757b 100644 >--- a/source3/winbindd/winbindd_cm.c >+++ b/source3/winbindd/winbindd_cm.c >@@ -2574,8 +2574,8 @@ retry: > goto anonymous; > } > >- remote_name = smbXcli_conn_remote_name(conn->cli->conn); >- remote_sockaddr = smbXcli_conn_remote_sockaddr(conn->cli->conn); >+ remote_name = domain->dcname; >+ remote_sockaddr = &domain->dcaddr; > > /* > * We have an authenticated connection. Use a SPNEGO >@@ -2849,8 +2849,8 @@ static NTSTATUS cm_connect_lsa_tcp(struct winbindd_domain *domain, > goto done; > } > >- remote_name = smbXcli_conn_remote_name(conn->cli->conn); >- remote_sockaddr = smbXcli_conn_remote_sockaddr(conn->cli->conn); >+ remote_name = domain->dcname; >+ remote_sockaddr = &domain->dcaddr; > > status = winbindd_get_trust_credentials(domain, > talloc_tos(), >@@ -2940,8 +2940,8 @@ retry: > goto anonymous; > } > >- remote_name = smbXcli_conn_remote_name(conn->cli->conn); >- remote_sockaddr = smbXcli_conn_remote_sockaddr(conn->cli->conn); >+ remote_name = domain->dcname; >+ remote_sockaddr = &domain->dcaddr; > > /* > * We have an authenticated connection. Use a SPNEGO >@@ -3225,8 +3225,8 @@ static NTSTATUS cm_connect_netlogon_transport(struct winbindd_domain *domain, > TALLOC_FREE(conn->netlogon_pipe); > TALLOC_FREE(conn->netlogon_creds_ctx); > >- remote_name = smbXcli_conn_remote_name(conn->cli->conn); >- remote_sockaddr = smbXcli_conn_remote_sockaddr(conn->cli->conn); >+ remote_name = domain->dcname; >+ remote_sockaddr = &domain->dcaddr; > > result = winbindd_get_trust_credentials(domain, > talloc_tos(), >-- >2.43.0 > > >From d312d06fc95a4dc6c924226cbc6507eaa73e907e Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Mon, 27 Apr 2026 18:13:36 +0200 >Subject: [PATCH 3/3] s3:winbindd: let wb_irpc_SamLogon reject the local domain > as RWDC > >If the clients use a subdomain of our domain the >'sam' auth backend passed the request along to >the 'winbind' auth backend. If winbindd tries >to use the local domain we hit the case that >an unknown domain was used. So we need to >bounce the request back to 'sam_ignoredomain'. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=15973 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Volker Lendecke <vl@samba.org> > >Autobuild-User(master): Volker Lendecke <vl@samba.org> >Autobuild-Date(master): Tue Apr 28 11:49:16 UTC 2026 on atb-devel-224 > >(cherry picked from commit b4e612725f9fe11f1791bd170cef8b0dade45ba6) >--- > source3/winbindd/winbindd_irpc.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > >diff --git a/source3/winbindd/winbindd_irpc.c b/source3/winbindd/winbindd_irpc.c >index 5981eb2d2445..7f36d7795fa0 100644 >--- a/source3/winbindd/winbindd_irpc.c >+++ b/source3/winbindd/winbindd_irpc.c >@@ -252,6 +252,30 @@ static NTSTATUS wb_irpc_SamLogon(struct irpc_message *msg, > return NT_STATUS_OK; > } > >+ if (IS_DC && domain->primary && !domain->rodc) { >+ /* >+ * target_domain_name might >+ * be a subdomain of domain->alt_name, >+ * that's why the 'sam' backend passed it along >+ * to 'winbind' auth backend, but we need to bounce >+ * it back to the 'sam_ignoredomain' backend. >+ */ >+ DBG_NOTICE("target_domain[%s] routed to primary domain[%s][%s]\n", >+ target_domain_name, domain->name, domain->alt_name); >+ req->out.result = NT_STATUS_NO_SUCH_DOMAIN; >+ req->out.authoritative = 0; >+ return NT_STATUS_OK; >+ } >+ >+ if (IS_DC && domain->internal && !domain->rodc) { >+ /* >+ * Something strange happened >+ */ >+ DBG_ERR("target_domain[%s] routed to internal domain[%s\n", >+ target_domain_name, domain->name); >+ return NT_STATUS_REQUEST_NOT_ACCEPTED; >+ } >+ > DEBUG(5, ("wb_irpc_SamLogon called\n")); > > return wb_irpc_forward_rpc_call(msg, msg, >-- >2.43.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
vl
:
review+
Actions:
View
Attachments on
bug 15973
: 18953 |
18954