[SCM] Samba Shared Repository - branch v3-5-test updated
Karolin Seeger
kseeger at samba.org
Mon Mar 15 09:06:03 MDT 2010
The branch, v3-5-test has been updated
via 6bda490... s3:smbd: make sure we always have a valid talloc stackframe
via 29eb47b... talloc_stack: reset stackframe pointers to NULL
via 0c0e54c... talloc_stack: make sure we never let talloc_tos() return ts->talloc_stack[-1]
from eb81e0d... s3-netlogon: Fix bug #7237: _netr_SamLogon segfaults for clients sending NULL domain.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test
- Log -----------------------------------------------------------------
commit 6bda49023a9e748776438cfc419a2ed7afd78920
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Mar 15 14:42:17 2010 +0100
s3:smbd: make sure we always have a valid talloc stackframe
metze
(cherry picked from commit 386f15c62bb4d3517de719c750252e06cf3b1fb1)
Last 3 patches address bug #7251 (Segfault in DEBUG(2,("waiting for
connections...)
commit 29eb47bdaf9a80e819c30e4c1fac9d07040d32bc
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Mar 15 14:39:11 2010 +0100
talloc_stack: reset stackframe pointers to NULL
This makes it easier to debug the code in future.
metze
(cherry picked from commit d23581b4d7a4936002c1d2d748836aead9215120)
commit 0c0e54cbb967150b91b3d83fb75c8c971875cb21
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon Mar 15 14:32:52 2010 +0100
talloc_stack: make sure we never let talloc_tos() return ts->talloc_stack[-1]
In smbd there's a small gab between TALLOC_FREE(frame); before
we call smbd_parent_loop() where we don't have a valid talloc stackframe.
smbd_parent_loop() calls talloc_stackframe() only within the while(1) loop.
As DEBUG(2,("waiting for connections")) uses talloc_tos() to construct
the time header for the debug message we crash on some systems.
metze
(cherry picked from commit 10ed809a1a31be50ce09142eb99b3a243ae8b940)
-----------------------------------------------------------------------
Summary of changes:
lib/util/talloc_stack.c | 4 +++-
source3/smbd/server.c | 3 +++
2 files changed, 6 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/talloc_stack.c b/lib/util/talloc_stack.c
index 596efbf..f34d495 100644
--- a/lib/util/talloc_stack.c
+++ b/lib/util/talloc_stack.c
@@ -103,8 +103,10 @@ static int talloc_pop(TALLOC_CTX *frame)
break;
}
talloc_free(ts->talloc_stack[i]);
+ ts->talloc_stack[i] = NULL;
}
+ ts->talloc_stack[i] = NULL;
ts->talloc_stacksize = i;
return 0;
}
@@ -181,7 +183,7 @@ TALLOC_CTX *talloc_tos(void)
struct talloc_stackframe *ts =
(struct talloc_stackframe *)SMB_THREAD_GET_TLS(global_ts);
- if (ts == NULL) {
+ if (ts == NULL || ts->talloc_stacksize == 0) {
talloc_stackframe();
ts = (struct talloc_stackframe *)SMB_THREAD_GET_TLS(global_ts);
DEBUG(0, ("no talloc stackframe around, leaking memory\n"));
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 09ad8d8..f719961 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1272,9 +1272,12 @@ extern void build_options(bool screen);
exit_server("open_sockets_smbd() failed");
TALLOC_FREE(frame);
+ /* make sure we always have a valid stackframe */
+ frame = talloc_stackframe();
smbd_parent_loop(parent);
exit_server_cleanly(NULL);
+ TALLOC_FREE(frame);
return(0);
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list