Lines Matching defs:addfd

92 	 * dying, a new seccomp addfd message, or changing to REPLIED
98 /* outstanding addfd requests */
99 struct list_head addfd;
1124 static void seccomp_handle_addfd(struct seccomp_kaddfd *addfd, struct seccomp_knotif *n)
1132 list_del_init(&addfd->list);
1133 if (!addfd->setfd)
1134 fd = receive_fd(addfd->file, NULL, addfd->flags);
1136 fd = receive_fd_replace(addfd->fd, addfd->file, addfd->flags);
1137 addfd->ret = fd;
1139 if (addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_SEND) {
1152 * Mark the notification as completed. From this point, addfd mem
1155 complete(&addfd->completion);
1172 struct seccomp_kaddfd *addfd, *tmp;
1185 INIT_LIST_HEAD(&n.addfd);
1215 addfd = list_first_entry_or_null(&n.addfd,
1217 /* Check if we were woken up by a addfd message */
1218 if (addfd)
1219 seccomp_handle_addfd(addfd, &n);
1228 /* If there were any pending addfd calls, clear them out */
1229 list_for_each_entry_safe(addfd, tmp, &n.addfd, list) {
1231 addfd->ret = -ESRCH;
1232 list_del_init(&addfd->list);
1233 complete(&addfd->completion);
1477 * We do not need to wake up any pending addfd messages, as
1714 struct seccomp_notif_addfd addfd;
1719 BUILD_BUG_ON(sizeof(addfd) < SECCOMP_NOTIFY_ADDFD_SIZE_VER0);
1720 BUILD_BUG_ON(sizeof(addfd) != SECCOMP_NOTIFY_ADDFD_SIZE_LATEST);
1725 ret = copy_struct_from_user(&addfd, sizeof(addfd), uaddfd, size);
1729 if (addfd.newfd_flags & ~O_CLOEXEC)
1732 if (addfd.flags & ~(SECCOMP_ADDFD_FLAG_SETFD | SECCOMP_ADDFD_FLAG_SEND))
1735 if (addfd.newfd && !(addfd.flags & SECCOMP_ADDFD_FLAG_SETFD))
1738 kaddfd.file = fget(addfd.srcfd);
1742 kaddfd.ioctl_flags = addfd.flags;
1743 kaddfd.flags = addfd.newfd_flags;
1744 kaddfd.setfd = addfd.flags & SECCOMP_ADDFD_FLAG_SETFD;
1745 kaddfd.fd = addfd.newfd;
1752 knotif = find_notification(filter, addfd.id);
1768 if (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) {
1770 * Disallow queuing an atomic addfd + send reply while there are
1771 * some addfd requests still to process.
1776 if (!list_empty(&knotif->addfd)) {
1785 list_add(&kaddfd.list, &knotif->addfd);
1794 * removed us from the addfd queue, and
1808 * We need to check again if the addfd request has been handled,