diff options
-rw-r--r-- | sys/kern/kern_event.c | 6 | ||||
-rw-r--r-- | sys/kern/sys_generic.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_mqueue.c | 4 | ||||
-rw-r--r-- | sys/sys/capability.h | 4 | ||||
-rw-r--r-- | tools/regression/security/cap_test/cap_test_capabilities.c | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 6ec8503..e282cd5 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -817,7 +817,7 @@ kern_kevent(struct thread *td, int fd, int nchanges, int nevents, struct file *fp; int i, n, nerrors, error; - if ((error = fget(td, fd, CAP_POST_KEVENT, &fp)) != 0) + if ((error = fget(td, fd, CAP_POST_EVENT, &fp)) != 0) return (error); if ((error = kqueue_acquire(fp, &kq)) != 0) goto done_norel; @@ -973,7 +973,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct thread *td, int wa findkn: if (fops->f_isfd) { KASSERT(td != NULL, ("td is NULL")); - error = fget(td, kev->ident, CAP_POLL_KEVENT, &fp); + error = fget(td, kev->ident, CAP_POLL_EVENT, &fp); if (error) goto done; @@ -2182,7 +2182,7 @@ kqfd_register(int fd, struct kevent *kev, struct thread *td, int waitok) struct file *fp; int error; - if ((error = fget(td, fd, CAP_POST_KEVENT, &fp)) != 0) + if ((error = fget(td, fd, CAP_POST_EVENT, &fp)) != 0) return (error); if ((error = kqueue_acquire(fp, &kq)) != 0) goto noacquire; diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index f94be5a..7dc69a6e 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1072,7 +1072,7 @@ getselfd_cap(struct filedesc *fdp, int fd, struct file **fpp) * If the file descriptor is for a capability, test rights and use * the file descriptor references by the capability. */ - error = cap_funwrap(fp, CAP_POLL_KEVENT, &fp_fromcap); + error = cap_funwrap(fp, CAP_POLL_EVENT, &fp_fromcap); if (error) { fdrop(fp, curthread); return (error); diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index e13912c..0ca4161 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -2119,7 +2119,7 @@ static __inline int getmq(struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq) { - return _getmq(td, fd, CAP_POLL_KEVENT, fget, fpp, ppn, pmq); + return _getmq(td, fd, CAP_POLL_EVENT, fget, fpp, ppn, pmq); } static __inline int @@ -2274,7 +2274,7 @@ again: error = EBADF; goto out; } - error = cap_funwrap(fp2, CAP_POLL_KEVENT, &fp2); + error = cap_funwrap(fp2, CAP_POLL_EVENT, &fp2); if (error) { FILEDESC_SUNLOCK(fdp); goto out; diff --git a/sys/sys/capability.h b/sys/sys/capability.h index 0f621f4..54fcaa0 100644 --- a/sys/sys/capability.h +++ b/sys/sys/capability.h @@ -124,8 +124,8 @@ #define CAP_SEM_WAIT 0x0000800000000000ULL /* kqueue events. */ -#define CAP_POLL_KEVENT 0x0001000000000000ULL -#define CAP_POST_KEVENT 0x0002000000000000ULL +#define CAP_POLL_EVENT 0x0001000000000000ULL +#define CAP_POST_EVENT 0x0002000000000000ULL /* Strange and powerful rights that should not be given lightly. */ #define CAP_IOCTL 0x0004000000000000ULL diff --git a/tools/regression/security/cap_test/cap_test_capabilities.c b/tools/regression/security/cap_test/cap_test_capabilities.c index 47c0142..ab1c58f 100644 --- a/tools/regression/security/cap_test/cap_test_capabilities.c +++ b/tools/regression/security/cap_test/cap_test_capabilities.c @@ -237,8 +237,8 @@ test_capabilities(void) TRY(fd, CAP_MMAP | CAP_MAPEXEC | CAP_WRITE); TRY(fd, CAP_MMAP | CAP_READ | CAP_WRITE | CAP_MAPEXEC); TRY(fd, CAP_FCNTL); - TRY(fd, CAP_POST_KEVENT); - TRY(fd, CAP_POLL_KEVENT); + TRY(fd, CAP_POST_EVENT); + TRY(fd, CAP_POLL_EVENT); TRY(fd, CAP_FSYNC); TRY(fd, CAP_FCHOWN); TRY(fd, CAP_FCHMOD); |