Lines Matching refs:addfd
99 struct list_head addfd; member
1046 static void seccomp_handle_addfd(struct seccomp_kaddfd *addfd, struct seccomp_knotif *n) in seccomp_handle_addfd() argument
1054 list_del_init(&addfd->list); in seccomp_handle_addfd()
1055 if (!addfd->setfd) in seccomp_handle_addfd()
1056 fd = receive_fd(addfd->file, addfd->flags); in seccomp_handle_addfd()
1058 fd = receive_fd_replace(addfd->fd, addfd->file, addfd->flags); in seccomp_handle_addfd()
1059 addfd->ret = fd; in seccomp_handle_addfd()
1061 if (addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_handle_addfd()
1077 complete(&addfd->completion); in seccomp_handle_addfd()
1088 struct seccomp_kaddfd *addfd, *tmp; in seccomp_do_user_notification() local
1101 INIT_LIST_HEAD(&n.addfd); in seccomp_do_user_notification()
1116 addfd = list_first_entry_or_null(&n.addfd, in seccomp_do_user_notification()
1119 if (addfd) in seccomp_do_user_notification()
1120 seccomp_handle_addfd(addfd, &n); in seccomp_do_user_notification()
1130 list_for_each_entry_safe(addfd, tmp, &n.addfd, list) { in seccomp_do_user_notification()
1132 addfd->ret = -ESRCH; in seccomp_do_user_notification()
1133 list_del_init(&addfd->list); in seccomp_do_user_notification()
1134 complete(&addfd->completion); in seccomp_do_user_notification()
1559 struct seccomp_notif_addfd addfd; in seccomp_notify_addfd() local
1564 BUILD_BUG_ON(sizeof(addfd) < SECCOMP_NOTIFY_ADDFD_SIZE_VER0); in seccomp_notify_addfd()
1565 BUILD_BUG_ON(sizeof(addfd) != SECCOMP_NOTIFY_ADDFD_SIZE_LATEST); in seccomp_notify_addfd()
1570 ret = copy_struct_from_user(&addfd, sizeof(addfd), uaddfd, size); in seccomp_notify_addfd()
1574 if (addfd.newfd_flags & ~O_CLOEXEC) in seccomp_notify_addfd()
1577 if (addfd.flags & ~(SECCOMP_ADDFD_FLAG_SETFD | SECCOMP_ADDFD_FLAG_SEND)) in seccomp_notify_addfd()
1580 if (addfd.newfd && !(addfd.flags & SECCOMP_ADDFD_FLAG_SETFD)) in seccomp_notify_addfd()
1583 kaddfd.file = fget(addfd.srcfd); in seccomp_notify_addfd()
1587 kaddfd.ioctl_flags = addfd.flags; in seccomp_notify_addfd()
1588 kaddfd.flags = addfd.newfd_flags; in seccomp_notify_addfd()
1589 kaddfd.setfd = addfd.flags & SECCOMP_ADDFD_FLAG_SETFD; in seccomp_notify_addfd()
1590 kaddfd.fd = addfd.newfd; in seccomp_notify_addfd()
1597 knotif = find_notification(filter, addfd.id); in seccomp_notify_addfd()
1613 if (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_notify_addfd()
1621 if (!list_empty(&knotif->addfd)) { in seccomp_notify_addfd()
1630 list_add(&kaddfd.list, &knotif->addfd); in seccomp_notify_addfd()