The Samba-Bugzilla – Attachment 12492 Details for
Bug 12272
messaging subsystem crash - poll_funcs_tevent can select the wrong slot to replace when adding a new context.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am for 4.5.next
v4-5 (text/plain), 2.59 KB, created by
Jeremy Allison
on 2016-09-19 19:14:38 UTC
(
hide
)
Description:
git-am for 4.5.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2016-09-19 19:14:38 UTC
Size:
2.59 KB
patch
obsolete
>From a921ba92d7279fc561dfc3ec8dbd4de642e377a0 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 19 Sep 2016 11:42:05 -0700 >Subject: [PATCH 1/2] lib/poll_funcs: free contexts in > poll_funcs_state_destructor() > >This ensures the destructors get called in the proper order. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12272 > >Back-port from c132b78c484c14d255a98567e90b934b73ebf8c2 > >Signed-off-by: Ralph Boehme <slow@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >--- > lib/poll_funcs/poll_funcs_tevent.c | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/lib/poll_funcs/poll_funcs_tevent.c b/lib/poll_funcs/poll_funcs_tevent.c >index 8fdf080..6052077 100644 >--- a/lib/poll_funcs/poll_funcs_tevent.c >+++ b/lib/poll_funcs/poll_funcs_tevent.c >@@ -302,6 +302,9 @@ static int poll_funcs_state_destructor(struct poll_funcs_state *state) > for (i=0; i<state->num_watches; i++) { > TALLOC_FREE(state->watches[i]); > } >+ for (i=0; i<state->num_contexts; i++) { >+ TALLOC_FREE(state->contexts[i]); >+ } > return 0; > } > >-- >2.7.4 > > >From 2e827ba8266c6c72a4144fc43fe8b48a6f290e9a Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 19 Sep 2016 11:47:22 -0700 >Subject: [PATCH 2/2] lib: poll_funcs : poll_funcs_context_slot_find can select > the wrong slot to replace. > >Look for an exact match first, before a free slot. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=12272 > >Back-port from 085542fc93b3c603e8cda6e481e94d5fe2dfc669 > >Signed-off-by: Jeremy Allison <jra@samba.org> >Reviewed-by: Ralph Boehme <slow@samba.org> >--- > lib/poll_funcs/poll_funcs_tevent.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/lib/poll_funcs/poll_funcs_tevent.c b/lib/poll_funcs/poll_funcs_tevent.c >index 6052077..65adb2d 100644 >--- a/lib/poll_funcs/poll_funcs_tevent.c >+++ b/lib/poll_funcs/poll_funcs_tevent.c >@@ -318,15 +318,27 @@ static bool poll_funcs_context_slot_find(struct poll_funcs_state *state, > struct poll_funcs_tevent_context **contexts; > unsigned i; > >+ /* Look for an existing match first. */ > for (i=0; i<state->num_contexts; i++) { > struct poll_funcs_tevent_context *ctx = state->contexts[i]; > >- if ((ctx == NULL) || (ctx->ev == ev)) { >+ if (ctx != NULL && ctx->ev == ev) { > *slot = i; > return true; > } > } > >+ /* Now look for a free slot. */ >+ for (i=0; i<state->num_contexts; i++) { >+ struct poll_funcs_tevent_context *ctx = state->contexts[i]; >+ >+ if (ctx == NULL) { >+ *slot = i; >+ return true; >+ } >+ } >+ >+ > contexts = talloc_realloc(state, state->contexts, > struct poll_funcs_tevent_context *, > state->num_contexts + 1); >-- >2.7.4 >
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:
slow
:
review+
Actions:
View
Attachments on
bug 12272
:
12477
| 12492 |
12493