diff options
author | sp92102 <none@none> | 2007-03-04 19:53:36 -0800 |
---|---|---|
committer | sp92102 <none@none> | 2007-03-04 19:53:36 -0800 |
commit | 5f684e2446f4c94cb7a57d95d6251244202a78ce (patch) | |
tree | d16f52985b5c328917f6366dcb32e0f74eb43635 /usr | |
parent | 4e4761498aa6990539820cfc2ee7b1c7c53b6bc3 (diff) | |
download | illumos-gate-5f684e2446f4c94cb7a57d95d6251244202a78ce.tar.gz |
6422458 /dev/poll dp_nfds checking off-by-one; application failures ensue
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/uts/common/io/devpoll.c | 7 | ||||
-rw-r--r-- | usr/src/uts/common/syscall/poll.c | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/usr/src/uts/common/io/devpoll.c b/usr/src/uts/common/io/devpoll.c index 36f1e08e89..274737a147 100644 --- a/usr/src/uts/common/io/devpoll.c +++ b/usr/src/uts/common/io/devpoll.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -781,7 +780,7 @@ dpioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp, int *rvalp) * current maximum open file count. */ mutex_enter(&p->p_lock); - if (nfds >= p->p_fno_ctl) { + if (nfds > p->p_fno_ctl) { mutex_exit(&p->p_lock); DP_REFRELE(dpep); return (EINVAL); diff --git a/usr/src/uts/common/syscall/poll.c b/usr/src/uts/common/syscall/poll.c index 7e21cc06cf..ab62954123 100644 --- a/usr/src/uts/common/syscall/poll.c +++ b/usr/src/uts/common/syscall/poll.c @@ -355,7 +355,7 @@ poll_common(pollfd_t *fds, nfds_t nfds, timespec_t *tsp, k_sigset_t *ksetp) goto pollout; } - if (nfds >= p->p_fno_ctl) { + if (nfds > p->p_fno_ctl) { mutex_enter(&p->p_lock); (void) rctl_action(rctlproc_legacy[RLIMIT_NOFILE], p->p_rctls, p, RCA_SAFE); |