Lines Matching refs:addfd
99 struct list_head addfd; member
1123 static void seccomp_handle_addfd(struct seccomp_kaddfd *addfd, struct seccomp_knotif *n) in seccomp_handle_addfd() argument
1131 list_del_init(&addfd->list); in seccomp_handle_addfd()
1132 if (!addfd->setfd) in seccomp_handle_addfd()
1133 fd = receive_fd(addfd->file, NULL, addfd->flags); in seccomp_handle_addfd()
1135 fd = receive_fd_replace(addfd->fd, addfd->file, addfd->flags); in seccomp_handle_addfd()
1136 addfd->ret = fd; in seccomp_handle_addfd()
1138 if (addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_handle_addfd()
1154 complete(&addfd->completion); in seccomp_handle_addfd()
1171 struct seccomp_kaddfd *addfd, *tmp; in seccomp_do_user_notification() local
1184 INIT_LIST_HEAD(&n.addfd); in seccomp_do_user_notification()
1214 addfd = list_first_entry_or_null(&n.addfd, in seccomp_do_user_notification()
1217 if (addfd) in seccomp_do_user_notification()
1218 seccomp_handle_addfd(addfd, &n); in seccomp_do_user_notification()
1228 list_for_each_entry_safe(addfd, tmp, &n.addfd, list) { in seccomp_do_user_notification()
1230 addfd->ret = -ESRCH; in seccomp_do_user_notification()
1231 list_del_init(&addfd->list); in seccomp_do_user_notification()
1232 complete(&addfd->completion); in seccomp_do_user_notification()
1716 struct seccomp_notif_addfd addfd; in seccomp_notify_addfd() local
1721 BUILD_BUG_ON(sizeof(addfd) < SECCOMP_NOTIFY_ADDFD_SIZE_VER0); in seccomp_notify_addfd()
1722 BUILD_BUG_ON(sizeof(addfd) != SECCOMP_NOTIFY_ADDFD_SIZE_LATEST); in seccomp_notify_addfd()
1727 ret = copy_struct_from_user(&addfd, sizeof(addfd), uaddfd, size); in seccomp_notify_addfd()
1731 if (addfd.newfd_flags & ~O_CLOEXEC) in seccomp_notify_addfd()
1734 if (addfd.flags & ~(SECCOMP_ADDFD_FLAG_SETFD | SECCOMP_ADDFD_FLAG_SEND)) in seccomp_notify_addfd()
1737 if (addfd.newfd && !(addfd.flags & SECCOMP_ADDFD_FLAG_SETFD)) in seccomp_notify_addfd()
1740 kaddfd.file = fget(addfd.srcfd); in seccomp_notify_addfd()
1744 kaddfd.ioctl_flags = addfd.flags; in seccomp_notify_addfd()
1745 kaddfd.flags = addfd.newfd_flags; in seccomp_notify_addfd()
1746 kaddfd.setfd = addfd.flags & SECCOMP_ADDFD_FLAG_SETFD; in seccomp_notify_addfd()
1747 kaddfd.fd = addfd.newfd; in seccomp_notify_addfd()
1754 knotif = find_notification(filter, addfd.id); in seccomp_notify_addfd()
1770 if (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_notify_addfd()
1778 if (!list_empty(&knotif->addfd)) { in seccomp_notify_addfd()
1787 list_add(&kaddfd.list, &knotif->addfd); in seccomp_notify_addfd()