Lines Matching refs:addfd
101 struct list_head addfd; member
1056 static void seccomp_handle_addfd(struct seccomp_kaddfd *addfd, struct seccomp_knotif *n) in seccomp_handle_addfd() argument
1064 list_del_init(&addfd->list); in seccomp_handle_addfd()
1065 if (!addfd->setfd) in seccomp_handle_addfd()
1066 fd = receive_fd(addfd->file, addfd->flags); in seccomp_handle_addfd()
1068 fd = receive_fd_replace(addfd->fd, addfd->file, addfd->flags); in seccomp_handle_addfd()
1069 addfd->ret = fd; in seccomp_handle_addfd()
1071 if (addfd->ioctl_flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_handle_addfd()
1087 complete(&addfd->completion); in seccomp_handle_addfd()
1104 struct seccomp_kaddfd *addfd, *tmp; in seccomp_do_user_notification() local
1117 INIT_LIST_HEAD(&n.addfd); in seccomp_do_user_notification()
1146 addfd = list_first_entry_or_null(&n.addfd, in seccomp_do_user_notification()
1149 if (addfd) in seccomp_do_user_notification()
1150 seccomp_handle_addfd(addfd, &n); in seccomp_do_user_notification()
1160 list_for_each_entry_safe(addfd, tmp, &n.addfd, list) { in seccomp_do_user_notification()
1162 addfd->ret = -ESRCH; in seccomp_do_user_notification()
1163 list_del_init(&addfd->list); in seccomp_do_user_notification()
1164 complete(&addfd->completion); in seccomp_do_user_notification()
1598 struct seccomp_notif_addfd addfd; in seccomp_notify_addfd() local
1603 BUILD_BUG_ON(sizeof(addfd) < SECCOMP_NOTIFY_ADDFD_SIZE_VER0); in seccomp_notify_addfd()
1604 BUILD_BUG_ON(sizeof(addfd) != SECCOMP_NOTIFY_ADDFD_SIZE_LATEST); in seccomp_notify_addfd()
1609 ret = copy_struct_from_user(&addfd, sizeof(addfd), uaddfd, size); in seccomp_notify_addfd()
1613 if (addfd.newfd_flags & ~O_CLOEXEC) in seccomp_notify_addfd()
1616 if (addfd.flags & ~(SECCOMP_ADDFD_FLAG_SETFD | SECCOMP_ADDFD_FLAG_SEND)) in seccomp_notify_addfd()
1619 if (addfd.newfd && !(addfd.flags & SECCOMP_ADDFD_FLAG_SETFD)) in seccomp_notify_addfd()
1622 kaddfd.file = fget(addfd.srcfd); in seccomp_notify_addfd()
1626 kaddfd.ioctl_flags = addfd.flags; in seccomp_notify_addfd()
1627 kaddfd.flags = addfd.newfd_flags; in seccomp_notify_addfd()
1628 kaddfd.setfd = addfd.flags & SECCOMP_ADDFD_FLAG_SETFD; in seccomp_notify_addfd()
1629 kaddfd.fd = addfd.newfd; in seccomp_notify_addfd()
1636 knotif = find_notification(filter, addfd.id); in seccomp_notify_addfd()
1652 if (addfd.flags & SECCOMP_ADDFD_FLAG_SEND) { in seccomp_notify_addfd()
1660 if (!list_empty(&knotif->addfd)) { in seccomp_notify_addfd()
1669 list_add(&kaddfd.list, &knotif->addfd); in seccomp_notify_addfd()