summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-01-23 10:27:15 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-01-23 10:27:15 +0000
commit14cd6d7f4908ad37662142a9eb23619abef8e354 (patch)
tree42cd09ffa03d3c448fe2740ae38e51aa0e914bd1 /sys/kern/vfs_aio.c
parent769267adae2f6e9b153191869cd19ccad75210b1 (diff)
downloadFreeBSD-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.c21
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;
}
}
OpenPOWER on IntegriCloud