diff options
author | praks <none@none> | 2005-06-20 17:17:47 -0700 |
---|---|---|
committer | praks <none@none> | 2005-06-20 17:17:47 -0700 |
commit | f7ccf9b33cfadfb8dd726ebf0894960cb7982a75 (patch) | |
tree | e5b7b7b2ebcdfb423045904efda43ed47129e3e0 | |
parent | 581be483b38a68910f4866e61791c1b53d3b3b96 (diff) | |
download | illumos-joyent-f7ccf9b33cfadfb8dd726ebf0894960cb7982a75.tar.gz |
6281254 port_getn will trip on a NULL pointer and cause a panic
6241163 Using aio with event ports can hang the system
-rw-r--r-- | usr/src/uts/common/fs/portfs/port.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/os/aio_subr.c | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/usr/src/uts/common/fs/portfs/port.c b/usr/src/uts/common/fs/portfs/port.c index abed5a98d5..ab73baf10f 100644 --- a/usr/src/uts/common/fs/portfs/port.c +++ b/usr/src/uts/common/fs/portfs/port.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1523,9 +1523,11 @@ portnowait: pgt->pgt_rqtp = rqtp; } else { /* timeout already checked -> remember values */ - pgt->pgt_timecheck = timecheck; - pgt->pgt_rqtime = *rqtp; pgt->pgt_rqtp = rqtp; + if (rqtp != NULL) { + pgt->pgt_timecheck = timecheck; + pgt->pgt_rqtime = *rqtp; + } } if (blocking) /* timeout remaining */ diff --git a/usr/src/uts/common/os/aio_subr.c b/usr/src/uts/common/os/aio_subr.c index f12cac257a..9bdd826581 100644 --- a/usr/src/uts/common/os/aio_subr.c +++ b/usr/src/uts/common/os/aio_subr.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1281,8 +1281,9 @@ aio_close_port(void *arg, int port, pid_t pid, int lastclose) return; } aiop->aio_portpendcnt += counter; + mutex_exit(&aiop->aio_mutex); while (aiop->aio_portpendcnt) - cv_wait(&aiop->aio_portcv, &aiop->aio_mutex); + cv_wait(&aiop->aio_portcv, &aiop->aio_portq_mutex); /* * all pending AIOs are completed. @@ -1290,7 +1291,6 @@ aio_close_port(void *arg, int port, pid_t pid, int lastclose) */ reqp = aiop->aio_portq; - mutex_exit(&aiop->aio_mutex); headp = NULL; for (; reqp != NULL; reqp = next) { next = reqp->aio_req_next; |