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 303457 Details for
Bug 438623
autofs (2.6.24/SELinux) hangs on create_udp_client/tcp_client.
[?]
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]
Patch to fix incorrect pthreads condition handling for mount requests.
autofs-5.0.3-mount-thread-create-cond-handling.patch (text/plain), 8.79 KB, created by
Ian Kent
on 2008-04-23 08:50:29 UTC
(
hide
)
Description:
Patch to fix incorrect pthreads condition handling for mount requests.
Filename:
MIME Type:
Creator:
Ian Kent
Created:
2008-04-23 08:50:29 UTC
Size:
8.79 KB
patch
obsolete
>diff -up autofs-5.0.3/daemon/indirect.c.mount-thread-create-cond-handling autofs-5.0.3/daemon/indirect.c >--- autofs-5.0.3/daemon/indirect.c.mount-thread-create-cond-handling 2008-04-14 10:52:47.000000000 +0800 >+++ autofs-5.0.3/daemon/indirect.c 2008-04-14 10:53:04.000000000 +0800 >@@ -660,7 +660,7 @@ static void mount_mutex_unlock(void *arg > > static void *do_mount_indirect(void *arg) > { >- struct pending_args *mt; >+ struct pending_args *args, mt; > struct autofs_point *ap; > char buf[PATH_MAX + 1]; > struct stat st; >@@ -674,29 +674,28 @@ static void *do_mount_indirect(void *arg > struct thread_stdenv_vars *tsv; > int len, tmplen, grplen, status, state; > >- mt = (struct pending_args *) arg; >+ args = (struct pending_args *) arg; > > status = pthread_mutex_lock(&ma_mutex); > if (status) > fatal(status); > >- ap = mt->ap; >- mt->status = 0; >+ memcpy(&mt, args, sizeof(struct pending_args)); >+ >+ ap = mt.ap; > >- mt->signaled = 1; >- status = pthread_cond_signal(&mt->cond); >+ args->signaled = 1; >+ status = pthread_cond_signal(&args->cond); > if (status) > fatal(status); > > mount_mutex_unlock(NULL); > >- pthread_cleanup_push(free_pending_args, mt); >- pthread_cleanup_push(pending_cond_destroy, mt); >- pthread_cleanup_push(mount_send_fail, mt); >+ pthread_cleanup_push(mount_send_fail, &mt); > > pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &state); > >- len = ncat_path(buf, sizeof(buf), ap->path, mt->name, mt->len); >+ len = ncat_path(buf, sizeof(buf), ap->path, mt.name, mt.len); > if (!len) { > crit(ap->logopt, "path to be mounted is to long"); > pthread_setcancelstate(state, NULL); >@@ -704,7 +703,7 @@ static void *do_mount_indirect(void *arg > } > > status = lstat(buf, &st); >- if (status != -1 && !(S_ISDIR(st.st_mode) && st.st_dev == mt->dev)) { >+ if (status != -1 && !(S_ISDIR(st.st_mode) && st.st_dev == mt.dev)) { > error(ap->logopt, > "indirect trigger not valid or already mounted %s", buf); > pthread_setcancelstate(state, NULL); >@@ -725,8 +724,8 @@ static void *do_mount_indirect(void *arg > if (!tsv) > goto cont; > >- tsv->uid = mt->uid; >- tsv->gid = mt->gid; >+ tsv->uid = mt.uid; >+ tsv->gid = mt.gid; > > /* Try to get passwd info */ > >@@ -744,7 +743,7 @@ static void *do_mount_indirect(void *arg > goto cont; > } > >- status = getpwuid_r(mt->uid, ppw, pw_tmp, tmplen, pppw); >+ status = getpwuid_r(tsv->uid, ppw, pw_tmp, tmplen, pppw); > if (status || !ppw) { > error(ap->logopt, "failed to get passwd info from getpwuid_r"); > free(tsv); >@@ -798,7 +797,7 @@ static void *do_mount_indirect(void *arg > gr_tmp = tmp; > pgr = &gr; > ppgr = &pgr; >- status = getgrgid_r(mt->gid, pgr, gr_tmp, tmplen, ppgr); >+ status = getgrgid_r(tsv->gid, pgr, gr_tmp, tmplen, ppgr); > if (status != ERANGE) > break; > tmplen += grplen; >@@ -834,20 +833,18 @@ static void *do_mount_indirect(void *arg > free(tsv); > } > cont: >- status = lookup_nss_mount(ap, NULL, mt->name, mt->len); >+ status = lookup_nss_mount(ap, NULL, mt.name, mt.len); > pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &state); > if (status) { >- send_ready(ap->logopt, ap->ioctlfd, mt->wait_queue_token); >+ send_ready(ap->logopt, ap->ioctlfd, mt.wait_queue_token); > info(ap->logopt, "mounted %s", buf); > } else { >- send_fail(ap->logopt, ap->ioctlfd, mt->wait_queue_token); >+ send_fail(ap->logopt, ap->ioctlfd, mt.wait_queue_token); > info(ap->logopt, "failed to mount %s", buf); > } > pthread_setcancelstate(state, NULL); > > pthread_cleanup_pop(0); >- pthread_cleanup_pop(1); >- pthread_cleanup_pop(1); > > return NULL; > } >@@ -911,6 +908,8 @@ int handle_packet_missing_indirect(struc > return 1; > } > >+ pthread_cleanup_push(free_pending_args, mt); >+ pthread_cleanup_push(pending_cond_destroy, mt); > pthread_cleanup_push(mount_mutex_unlock, NULL); > pthread_setcancelstate(state, NULL); > >@@ -922,6 +921,8 @@ int handle_packet_missing_indirect(struc > } > > pthread_cleanup_pop(1); >+ pthread_cleanup_pop(1); >+ pthread_cleanup_pop(1); > > return 0; > } >diff -up autofs-5.0.3/daemon/direct.c.mount-thread-create-cond-handling autofs-5.0.3/daemon/direct.c >--- autofs-5.0.3/daemon/direct.c.mount-thread-create-cond-handling 2008-04-14 10:52:47.000000000 +0800 >+++ autofs-5.0.3/daemon/direct.c 2008-04-14 10:53:04.000000000 +0800 >@@ -1217,7 +1217,7 @@ static void mount_mutex_unlock(void *arg > > static void *do_mount_direct(void *arg) > { >- struct pending_args *mt; >+ struct pending_args *args, mt; > struct autofs_point *ap; > struct passwd pw; > struct passwd *ppw = &pw; >@@ -1231,47 +1231,47 @@ static void *do_mount_direct(void *arg) > struct stat st; > int status, state; > >- mt = (struct pending_args *) arg; >+ args = (struct pending_args *) arg; > > status = pthread_mutex_lock(&ma_mutex); > if (status) > fatal(status); > >- ap = mt->ap; >+ memcpy(&mt, args, sizeof(struct pending_args)); >+ >+ ap = mt.ap; > >- mt->signaled = 1; >- status = pthread_cond_signal(&mt->cond); >+ args->signaled = 1; >+ status = pthread_cond_signal(&args->cond); > if (status) > fatal(status); > > mount_mutex_unlock(NULL); > >- pthread_cleanup_push(free_pending_args, mt); >- pthread_cleanup_push(pending_cond_destroy, mt); >- pthread_cleanup_push(mount_send_fail, mt); >+ pthread_cleanup_push(mount_send_fail, &mt); > > pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &state); > >- status = fstat(mt->ioctlfd, &st); >+ status = fstat(mt.ioctlfd, &st); > if (status == -1) { > error(ap->logopt, >- "can't stat direct mount trigger %s", mt->name); >+ "can't stat direct mount trigger %s", mt.name); > pthread_setcancelstate(state, NULL); > pthread_exit(NULL); > } > >- status = stat(mt->name, &st); >- if (!S_ISDIR(st.st_mode) || st.st_dev != mt->dev) { >+ status = stat(mt.name, &st); >+ if (!S_ISDIR(st.st_mode) || st.st_dev != mt.dev) { > error(ap->logopt, > "direct trigger not valid or already mounted %s", >- mt->name); >+ mt.name); > pthread_setcancelstate(state, NULL); > pthread_exit(NULL); > } > > pthread_setcancelstate(state, NULL); > >- info(ap->logopt, "attempting to mount entry %s", mt->name); >+ info(ap->logopt, "attempting to mount entry %s", mt.name); > > /* > * Setup thread specific data values for macro >@@ -1283,8 +1283,8 @@ static void *do_mount_direct(void *arg) > if (!tsv) > goto cont; > >- tsv->uid = mt->uid; >- tsv->gid = mt->gid; >+ tsv->uid = mt.uid; >+ tsv->gid = mt.gid; > > /* Try to get passwd info */ > >@@ -1302,7 +1302,7 @@ static void *do_mount_direct(void *arg) > goto cont; > } > >- status = getpwuid_r(mt->uid, ppw, pw_tmp, tmplen, pppw); >+ status = getpwuid_r(tsv->uid, ppw, pw_tmp, tmplen, pppw); > if (status || !ppw) { > error(ap->logopt, "failed to get passwd info from getpwuid_r"); > free(tsv); >@@ -1356,7 +1356,7 @@ static void *do_mount_direct(void *arg) > gr_tmp = tmp; > pgr = &gr; > ppgr = &pgr; >- status = getgrgid_r(mt->gid, pgr, gr_tmp, tmplen, ppgr); >+ status = getgrgid_r(tsv->gid, pgr, gr_tmp, tmplen, ppgr); > if (status != ERANGE) > break; > tmplen += grplen; >@@ -1393,7 +1393,7 @@ static void *do_mount_direct(void *arg) > } > > cont: >- status = lookup_nss_mount(ap, NULL, mt->name, strlen(mt->name)); >+ status = lookup_nss_mount(ap, NULL, mt.name, strlen(mt.name)); > /* > * Direct mounts are always a single mount. If it fails there's > * nothing to undo so just complain >@@ -1402,29 +1402,27 @@ cont: > if (status) { > struct mapent *me; > int real_mount, set_fd; >- cache_readlock(mt->mc); >- me = cache_lookup_distinct(mt->mc, mt->name); >+ cache_readlock(mt.mc); >+ me = cache_lookup_distinct(mt.mc, mt.name); > real_mount = is_mounted(_PATH_MOUNTED, me->key, MNTS_REAL); > set_fd = (real_mount || me->multi == me); >- cache_unlock(mt->mc); >+ cache_unlock(mt.mc); > if (set_fd) { >- me->ioctlfd = mt->ioctlfd; >- send_ready(ap->logopt, mt->ioctlfd, mt->wait_queue_token); >+ me->ioctlfd = mt.ioctlfd; >+ send_ready(ap->logopt, mt.ioctlfd, mt.wait_queue_token); > } else { >- send_ready(ap->logopt, mt->ioctlfd, mt->wait_queue_token); >- close(mt->ioctlfd); >+ send_ready(ap->logopt, mt.ioctlfd, mt.wait_queue_token); >+ close(mt.ioctlfd); > } >- info(ap->logopt, "mounted %s", mt->name); >+ info(ap->logopt, "mounted %s", mt.name); > } else { >- send_fail(mt->ap->logopt, mt->ioctlfd, mt->wait_queue_token); >- close(mt->ioctlfd); >- info(ap->logopt, "failed to mount %s", mt->name); >+ send_fail(ap->logopt, mt.ioctlfd, mt.wait_queue_token); >+ close(mt.ioctlfd); >+ info(ap->logopt, "failed to mount %s", mt.name); > } > pthread_setcancelstate(state, NULL); > > pthread_cleanup_pop(0); >- pthread_cleanup_pop(1); >- pthread_cleanup_pop(1); > > return NULL; > } >@@ -1553,6 +1551,8 @@ int handle_packet_missing_direct(struct > } > > cache_unlock(mc); >+ pthread_cleanup_push(free_pending_args, mt); >+ pthread_cleanup_push(pending_cond_destroy, mt); > pthread_cleanup_push(mount_mutex_unlock, NULL); > pthread_setcancelstate(state, NULL); > >@@ -1564,6 +1564,8 @@ int handle_packet_missing_direct(struct > } > > pthread_cleanup_pop(1); >+ pthread_cleanup_pop(1); >+ pthread_cleanup_pop(1); > > return 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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 438623
:
301947
|
302253
|
303269
| 303457