Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 838646 Details for
Bug 1044735
krb5_copy_context seg faults
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
rolled up pull requests to fix krb5_copy_context seg fault and double free
krb5-copy-ctx.patch (text/plain), 3.70 KB, created by
John Dennis
on 2013-12-18 21:49:51 UTC
(
hide
)
Description:
rolled up pull requests to fix krb5_copy_context seg fault and double free
Filename:
MIME Type:
Creator:
John Dennis
Created:
2013-12-18 21:49:51 UTC
Size:
3.70 KB
patch
obsolete
>diff -r -u krb5-1.11.3.orig/src/lib/krb5/krb/copy_ctx.c krb5-1.11.3/src/lib/krb5/krb/copy_ctx.c >--- krb5-1.11.3.orig/src/lib/krb5/krb/copy_ctx.c 2013-12-16 17:43:08.000000000 -0500 >+++ krb5-1.11.3/src/lib/krb5/krb/copy_ctx.c 2013-12-16 17:50:03.000000000 -0500 >@@ -85,12 +85,24 @@ > > memset(&nctx->err, 0, sizeof(nctx->err)); > >- ret = k5_copy_etypes(ctx->in_tkt_etypes, &nctx->in_tkt_etypes); >- if (ret) >- goto errout; >- ret = k5_copy_etypes(ctx->tgs_etypes, &nctx->tgs_etypes); >- if (ret) >- goto errout; >+ if (ctx->in_tkt_etypes != NULL) { >+ ret = k5_copy_etypes(ctx->in_tkt_etypes, &nctx->in_tkt_etypes); >+ if (ret) >+ goto errout; >+ } >+ if (ctx->tgs_etypes != NULL) { >+ ret = k5_copy_etypes(ctx->tgs_etypes, &nctx->tgs_etypes); >+ if (ret) >+ goto errout; >+ } >+ >+ if (ctx->plugin_base_dir != NULL) { >+ nctx->plugin_base_dir = strdup(ctx->plugin_base_dir); >+ if (nctx->plugin_base_dir == NULL) { >+ ret = ENOMEM; >+ goto errout; >+ } >+ } > > if (ctx->os_context.default_ccname != NULL) { > nctx->os_context.default_ccname = >Only in krb5-1.11.3/src/lib/krb5/krb: copy_ctx.c.orig >diff -r -u krb5-1.11.3.orig/src/tests/threads/init_ctx.c krb5-1.11.3/src/tests/threads/init_ctx.c >--- krb5-1.11.3.orig/src/tests/threads/init_ctx.c 2013-12-16 17:43:49.000000000 -0500 >+++ krb5-1.11.3/src/tests/threads/init_ctx.c 2013-12-16 17:50:18.000000000 -0500 >@@ -59,6 +59,7 @@ > static unsigned int n_threads = N_THREADS; > static int iter_count = ITER_COUNT; > static int do_pause; >+static int do_copy; > > static void usage (void) __attribute__((noreturn)); > >@@ -73,6 +74,7 @@ > ITER_COUNT); > fprintf (stderr, "\t-K\tinitialize a krb5_context for the duration\n"); > fprintf (stderr, "\t-P\tpause briefly after starting, to allow attaching dtrace/strace/etc\n"); >+ fprintf (stderr, "\t-C\tcopy, don't initialise context for each iteration\n"); > exit (1); > } > >@@ -94,7 +96,7 @@ > usage (); > } > >-static char optstring[] = "t:i:KP"; >+static char optstring[] = "t:i:KPC"; > > static void > process_options (int argc, char *argv[]) >@@ -132,6 +134,10 @@ > case 'P': > do_pause = 1; > break; >+ >+ case 'C': >+ do_copy = 1; >+ break; > } > } > if (argc != optind) >@@ -157,7 +163,7 @@ > return tv; > } > >-static void run_iterations (struct resource_info *r) >+static void run_iterations_init (struct resource_info *r) > { > int i; > krb5_error_code err; >@@ -176,9 +182,41 @@ > } > > static void * >-thread_proc (void *p) >+thread_proc_init (void *p) >+{ >+ run_iterations_init (p); >+ return 0; >+} >+ >+static void run_iterations_copy (struct resource_info *r) >+{ >+ int i; >+ krb5_error_code err; >+ krb5_context ctx, nctx; >+ >+ err = krb5_init_context(&ctx); >+ if (err) { >+ com_err(prog, err, "initializing krb5 context"); >+ exit(1); >+ >+ } >+ >+ r->start_time = now (); >+ for (i = 0; i < iter_count; i++) { >+ err = krb5_copy_context(ctx, &nctx); >+ if (err) { >+ com_err(prog, err, "copying krb5 context"); >+ exit(1); >+ } >+ krb5_free_context(nctx); >+ } >+ r->end_time = now (); >+} >+ >+static void * >+thread_proc_copy (void *p) > { >- run_iterations (p); >+ run_iterations_copy (p); > return 0; > } > >@@ -225,7 +263,7 @@ > foreach_thread (i) { > int err; > >- err = pthread_create (&tinfo[i].tid, NULL, thread_proc, &tinfo[i].r); >+ err = pthread_create (&tinfo[i].tid, NULL, do_copy ? thread_proc_copy : thread_proc_init, &tinfo[i].r); > if (err) { > fprintf (stderr, "pthread_create: %s\n", strerror (err)); > exit (1);
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1044735
: 838646