Lines Matching refs:addfd

101 	struct list_head addfd;  member
1065 static void seccomp_handle_addfd(struct seccomp_kaddfd *addfd, struct seccomp_knotif *n) in seccomp_handle_addfd() argument
1073 list_del_init(&addfd->list); in seccomp_handle_addfd()
1074 if (!addfd->setfd) in seccomp_handle_addfd()
1075 fd = receive_fd(addfd->file, addfd->flags); in seccomp_handle_addfd()
1077 fd = receive_fd_replace(addfd->fd, addfd->file, addfd->flags); in seccomp_handle_addfd()
1078 addfd->ret = fd; in seccomp_handle_addfd()
1080 if (addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_handle_addfd()
1096 complete(&addfd->completion); in seccomp_handle_addfd()
1113 struct seccomp_kaddfd *addfd, *tmp; in seccomp_do_user_notification() local
1126 INIT_LIST_HEAD(&n.addfd); in seccomp_do_user_notification()
1158 addfd = list_first_entry_or_null(&n.addfd, in seccomp_do_user_notification()
1161 if (addfd) in seccomp_do_user_notification()
1162 seccomp_handle_addfd(addfd, &n); in seccomp_do_user_notification()
1172 list_for_each_entry_safe(addfd, tmp, &n.addfd, list) { in seccomp_do_user_notification()
1174 addfd->ret = -ESRCH; in seccomp_do_user_notification()
1175 list_del_init(&addfd->list); in seccomp_do_user_notification()
1176 complete(&addfd->completion); in seccomp_do_user_notification()
1661 struct seccomp_notif_addfd addfd; in seccomp_notify_addfd() local
1666 BUILD_BUG_ON(sizeof(addfd) < SECCOMP_NOTIFY_ADDFD_SIZE_VER0); in seccomp_notify_addfd()
1667 BUILD_BUG_ON(sizeof(addfd) != SECCOMP_NOTIFY_ADDFD_SIZE_LATEST); in seccomp_notify_addfd()
1672 ret = copy_struct_from_user(&addfd, sizeof(addfd), uaddfd, size); in seccomp_notify_addfd()
1676 if (addfd.newfd_flags & ~O_CLOEXEC) in seccomp_notify_addfd()
1679 if (addfd.flags & ~(SECCOMP_ADDFD_FLAG_SETFD | SECCOMP_ADDFD_FLAG_SEND)) in seccomp_notify_addfd()
1682 if (addfd.newfd && !(addfd.flags & SECCOMP_ADDFD_FLAG_SETFD)) in seccomp_notify_addfd()
1685 kaddfd.file = fget(addfd.srcfd); in seccomp_notify_addfd()
1689 kaddfd.ioctl_flags = addfd.flags; in seccomp_notify_addfd()
1690 kaddfd.flags = addfd.newfd_flags; in seccomp_notify_addfd()
1691 kaddfd.setfd = addfd.flags & SECCOMP_ADDFD_FLAG_SETFD; in seccomp_notify_addfd()
1692 kaddfd.fd = addfd.newfd; in seccomp_notify_addfd()
1699 knotif = find_notification(filter, addfd.id); in seccomp_notify_addfd()
1715 if (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_notify_addfd()
1723 if (!list_empty(&knotif->addfd)) { in seccomp_notify_addfd()
1732 list_add(&kaddfd.list, &knotif->addfd); in seccomp_notify_addfd()