diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-01-23 10:27:15 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-01-23 10:27:15 +0000 |
commit | 14cd6d7f4908ad37662142a9eb23619abef8e354 (patch) | |
tree | 42cd09ffa03d3c448fe2740ae38e51aa0e914bd1 /sys/kern/vfs_aio.c | |
parent | 769267adae2f6e9b153191869cd19ccad75210b1 (diff) | |
download | FreeBSD-src-14cd6d7f4908ad37662142a9eb23619abef8e354.zip FreeBSD-src-14cd6d7f4908ad37662142a9eb23619abef8e354.tar.gz |
Verify all supported notification types.
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 4efe205..b89b094 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -1296,6 +1296,16 @@ aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj, uma_zfree(aiocb_zone, aiocbe); return (error); } + + if (aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_KEVENT && + aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_SIGNAL && + aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_THREAD_ID && + aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_NONE) { + suword(&job->_aiocb_private.error, EINVAL); + uma_zfree(aiocb_zone, aiocbe); + return (EINVAL); + } + if ((aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL || aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_THREAD_ID) && !_SIG_VALID(aiocbe->uaiocb.aio_sigevent.sigev_signo)) { @@ -1892,11 +1902,16 @@ do_lio_listio(struct thread *td, struct lio_listio_args *uap, int oldsigev) } } else if (lj->lioj_signal.sigev_notify == SIGEV_NONE) { ; - } else if (!_SIG_VALID(lj->lioj_signal.sigev_signo)) { + } else if (lj->lioj_signal.sigev_notify == SIGEV_SIGNAL || + lj->lioj_signal.sigev_notify == SIGEV_THREAD_ID) { + if (!_SIG_VALID(lj->lioj_signal.sigev_signo)) { + uma_zfree(aiolio_zone, lj); + return EINVAL; + } + lj->lioj_flags |= LIOJ_SIGNAL; + } else { uma_zfree(aiolio_zone, lj); return EINVAL; - } else { - lj->lioj_flags |= LIOJ_SIGNAL; } } |