Lines Matching +full:flags +full:- +full:mask
1 // SPDX-License-Identifier: GPL-2.0
34 * All flags that may be specified in parameter event_f_flags of fanotify_init.
36 * Internal and external open flags are stored together in field f_flags of
37 * struct file. Only external open flags shall be allowed in event_f_flags.
38 * Internal flags like FMODE_NONOTIFY, FMODE_EXEC, FMODE_NOCMTIME shall be
77 info_len += fanotify_fid_info_len(dir_fh_len, info->name_len); in fanotify_event_info_len()
78 } else if ((fid_mode & FAN_REPORT_NAME) && (event->mask & FAN_ONDIR)) { in fanotify_event_info_len()
107 spin_lock(&group->notification_lock); in get_one_event()
117 event = ERR_PTR(-EINVAL); in get_one_event()
121 if (fanotify_is_perm_event(event->mask)) in get_one_event()
122 FANOTIFY_PERM(event)->state = FAN_EVENT_REPORTED; in get_one_event()
124 spin_unlock(&group->notification_lock); in get_one_event()
134 client_fd = get_unused_fd_flags(group->fanotify_data.f_flags); in create_fd()
143 group->fanotify_data.f_flags | FMODE_NONOTIFY, in create_fd()
164 * drop group->notification_lock.
169 __releases(&group->notification_lock) in finish_permission_event()
173 assert_spin_locked(&group->notification_lock); in finish_permission_event()
174 event->response = response; in finish_permission_event()
175 if (event->state == FAN_EVENT_CANCELED) in finish_permission_event()
178 event->state = FAN_EVENT_ANSWERED; in finish_permission_event()
179 spin_unlock(&group->notification_lock); in finish_permission_event()
181 fsnotify_destroy_event(group, &event->fae.fse); in finish_permission_event()
188 int fd = response_struct->fd; in process_access_response()
189 int response = response_struct->response; in process_access_response()
203 return -EINVAL; in process_access_response()
207 return -EINVAL; in process_access_response()
210 return -EINVAL; in process_access_response()
212 spin_lock(&group->notification_lock); in process_access_response()
213 list_for_each_entry(event, &group->fanotify_data.access_list, in process_access_response()
215 if (event->fd != fd) in process_access_response()
218 list_del_init(&event->fae.fse.list); in process_access_response()
220 wake_up(&group->fanotify_data.access_waitq); in process_access_response()
223 spin_unlock(&group->notification_lock); in process_access_response()
225 return -ENOENT; in process_access_response()
235 size_t fh_len = fh ? fh->len : 0; in copy_info_to_user()
246 return -EFAULT; in copy_info_to_user()
256 return -EFAULT; in copy_info_to_user()
260 return -EFAULT; in copy_info_to_user()
263 return -EFAULT; in copy_info_to_user()
270 return -EFAULT; in copy_info_to_user()
273 len -= sizeof(info); in copy_info_to_user()
275 return -EFAULT; in copy_info_to_user()
277 handle.handle_type = fh->type; in copy_info_to_user()
280 return -EFAULT; in copy_info_to_user()
283 len -= sizeof(handle); in copy_info_to_user()
285 return -EFAULT; in copy_info_to_user()
297 return -EFAULT; in copy_info_to_user()
300 len -= fh_len; in copy_info_to_user()
306 return -EFAULT; in copy_info_to_user()
309 return -EFAULT; in copy_info_to_user()
312 len -= name_len; in copy_info_to_user()
318 return -EFAULT; in copy_info_to_user()
342 metadata.mask = event->mask & FANOTIFY_OUTGOING_EVENTS; in copy_event_to_user()
343 metadata.pid = pid_vnr(event->pid); in copy_event_to_user()
345 if (path && path->mnt && path->dentry) { in copy_event_to_user()
352 ret = -EFAULT; in copy_event_to_user()
364 count -= FAN_EVENT_METADATA_LEN; in copy_event_to_user()
366 if (fanotify_is_perm_event(event->mask)) in copy_event_to_user()
367 FANOTIFY_PERM(event)->fd = fd; in copy_event_to_user()
371 info_type = info->name_len ? FAN_EVENT_INFO_TYPE_DFID_NAME : in copy_event_to_user()
376 info->name_len, buf, count); in copy_event_to_user()
381 count -= ret; in copy_event_to_user()
395 (event->mask & FAN_ONDIR)) { in copy_event_to_user()
404 } else if ((event->mask & ALL_FSNOTIFY_DIRENT_EVENTS) || in copy_event_to_user()
405 (event->mask & FAN_ONDIR)) { in copy_event_to_user()
414 * With group flags FAN_REPORT_DIR_FID|FAN_REPORT_FID, in copy_event_to_user()
416 * non-directory, when there is no directory to report. in copy_event_to_user()
429 count -= ret; in copy_event_to_user()
448 struct fsnotify_group *group = file->private_data; in fanotify_poll()
451 poll_wait(file, &group->notification_waitq, wait); in fanotify_poll()
452 spin_lock(&group->notification_lock); in fanotify_poll()
455 spin_unlock(&group->notification_lock); in fanotify_poll()
470 group = file->private_data; in fanotify_read()
474 add_wait_queue(&group->notification_waitq, &wait); in fanotify_read()
488 ret = -EAGAIN; in fanotify_read()
489 if (file->f_flags & O_NONBLOCK) in fanotify_read()
492 ret = -ERESTARTSYS; in fanotify_read()
504 if (unlikely(ret == -EOPENSTALE)) { in fanotify_read()
509 * read (i.e. return bytes read, -EAGAIN or wait). in fanotify_read()
518 if (!fanotify_is_perm_event(event->mask)) { in fanotify_read()
519 fsnotify_destroy_event(group, &event->fse); in fanotify_read()
522 spin_lock(&group->notification_lock); in fanotify_read()
525 wake_up(&group->fanotify_data.access_waitq); in fanotify_read()
527 spin_lock(&group->notification_lock); in fanotify_read()
528 list_add_tail(&event->fse.list, in fanotify_read()
529 &group->fanotify_data.access_list); in fanotify_read()
530 spin_unlock(&group->notification_lock); in fanotify_read()
536 count -= ret; in fanotify_read()
538 remove_wait_queue(&group->notification_waitq, &wait); in fanotify_read()
540 if (start != buf && ret != -EFAULT) in fanotify_read()
541 ret = buf - start; in fanotify_read()
547 struct fanotify_response response = { .fd = -1, .response = -1 }; in fanotify_write()
552 return -EINVAL; in fanotify_write()
554 group = file->private_data; in fanotify_write()
557 return -EINVAL; in fanotify_write()
564 return -EFAULT; in fanotify_write()
575 struct fsnotify_group *group = file->private_data; in fanotify_release()
588 spin_lock(&group->notification_lock); in fanotify_release()
589 while (!list_empty(&group->fanotify_data.access_list)) { in fanotify_release()
592 event = list_first_entry(&group->fanotify_data.access_list, in fanotify_release()
594 list_del_init(&event->fae.fse.list); in fanotify_release()
596 spin_lock(&group->notification_lock); in fanotify_release()
600 * Destroy all non-permission events. For permission events just in fanotify_release()
608 if (!(event->mask & FANOTIFY_PERM_EVENTS)) { in fanotify_release()
609 spin_unlock(&group->notification_lock); in fanotify_release()
610 fsnotify_destroy_event(group, &event->fse); in fanotify_release()
615 spin_lock(&group->notification_lock); in fanotify_release()
617 spin_unlock(&group->notification_lock); in fanotify_release()
620 wake_up(&group->fanotify_data.access_waitq); in fanotify_release()
622 /* matches the fanotify_init->fsnotify_alloc_group */ in fanotify_release()
633 int ret = -ENOTTY; in fanotify_ioctl()
636 group = file->private_data; in fanotify_ioctl()
642 spin_lock(&group->notification_lock); in fanotify_ioctl()
643 list_for_each_entry(fsn_event, &group->notification_list, list) in fanotify_ioctl()
645 spin_unlock(&group->notification_lock); in fanotify_ioctl()
666 struct path *path, unsigned int flags, __u64 mask, in fanotify_find_path() argument
671 pr_debug("%s: dfd=%d filename=%p flags=%x\n", __func__, in fanotify_find_path()
672 dfd, filename, flags); in fanotify_find_path()
677 ret = -EBADF; in fanotify_find_path()
681 ret = -ENOTDIR; in fanotify_find_path()
682 if ((flags & FAN_MARK_ONLYDIR) && in fanotify_find_path()
683 !(S_ISDIR(file_inode(f.file)->i_mode))) { in fanotify_find_path()
688 *path = f.file->f_path; in fanotify_find_path()
694 if (!(flags & FAN_MARK_DONT_FOLLOW)) in fanotify_find_path()
696 if (flags & FAN_MARK_ONLYDIR) in fanotify_find_path()
705 ret = inode_permission(path->dentry->d_inode, MAY_READ); in fanotify_find_path()
711 ret = security_path_notify(path, mask, obj_type); in fanotify_find_path()
720 __u32 mask, unsigned int flags, in fanotify_mark_remove_from_mask() argument
726 mask &= ~umask; in fanotify_mark_remove_from_mask()
727 spin_lock(&fsn_mark->lock); in fanotify_mark_remove_from_mask()
728 if (!(flags & FAN_MARK_IGNORED_MASK)) { in fanotify_mark_remove_from_mask()
729 oldmask = fsn_mark->mask; in fanotify_mark_remove_from_mask()
730 fsn_mark->mask &= ~mask; in fanotify_mark_remove_from_mask()
732 fsn_mark->ignored_mask &= ~mask; in fanotify_mark_remove_from_mask()
735 * We need to keep the mark around even if remaining mask cannot in fanotify_mark_remove_from_mask()
736 * result in any events (e.g. mask == FAN_ONDIR) to support incremenal in fanotify_mark_remove_from_mask()
737 * changes to the mask. in fanotify_mark_remove_from_mask()
740 *destroy = !((fsn_mark->mask | fsn_mark->ignored_mask) & ~umask); in fanotify_mark_remove_from_mask()
741 spin_unlock(&fsn_mark->lock); in fanotify_mark_remove_from_mask()
743 return mask & oldmask; in fanotify_mark_remove_from_mask()
747 fsnotify_connp_t *connp, __u32 mask, in fanotify_remove_mark() argument
748 unsigned int flags, __u32 umask) in fanotify_remove_mark() argument
754 mutex_lock(&group->mark_mutex); in fanotify_remove_mark()
757 mutex_unlock(&group->mark_mutex); in fanotify_remove_mark()
758 return -ENOENT; in fanotify_remove_mark()
761 removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags, in fanotify_remove_mark()
763 if (removed & fsnotify_conn_mask(fsn_mark->connector)) in fanotify_remove_mark()
764 fsnotify_recalc_mask(fsn_mark->connector); in fanotify_remove_mark()
767 mutex_unlock(&group->mark_mutex); in fanotify_remove_mark()
777 struct vfsmount *mnt, __u32 mask, in fanotify_remove_vfsmount_mark() argument
778 unsigned int flags, __u32 umask) in fanotify_remove_vfsmount_mark() argument
780 return fanotify_remove_mark(group, &real_mount(mnt)->mnt_fsnotify_marks, in fanotify_remove_vfsmount_mark()
781 mask, flags, umask); in fanotify_remove_vfsmount_mark()
785 struct super_block *sb, __u32 mask, in fanotify_remove_sb_mark() argument
786 unsigned int flags, __u32 umask) in fanotify_remove_sb_mark() argument
788 return fanotify_remove_mark(group, &sb->s_fsnotify_marks, mask, in fanotify_remove_sb_mark()
789 flags, umask); in fanotify_remove_sb_mark()
793 struct inode *inode, __u32 mask, in fanotify_remove_inode_mark() argument
794 unsigned int flags, __u32 umask) in fanotify_remove_inode_mark() argument
796 return fanotify_remove_mark(group, &inode->i_fsnotify_marks, mask, in fanotify_remove_inode_mark()
797 flags, umask); in fanotify_remove_inode_mark()
801 __u32 mask, in fanotify_mark_add_to_mask() argument
802 unsigned int flags) in fanotify_mark_add_to_mask() argument
804 __u32 oldmask = -1; in fanotify_mark_add_to_mask()
806 spin_lock(&fsn_mark->lock); in fanotify_mark_add_to_mask()
807 if (!(flags & FAN_MARK_IGNORED_MASK)) { in fanotify_mark_add_to_mask()
808 oldmask = fsn_mark->mask; in fanotify_mark_add_to_mask()
809 fsn_mark->mask |= mask; in fanotify_mark_add_to_mask()
811 fsn_mark->ignored_mask |= mask; in fanotify_mark_add_to_mask()
812 if (flags & FAN_MARK_IGNORED_SURV_MODIFY) in fanotify_mark_add_to_mask()
813 fsn_mark->flags |= FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY; in fanotify_mark_add_to_mask()
815 spin_unlock(&fsn_mark->lock); in fanotify_mark_add_to_mask()
817 return mask & ~oldmask; in fanotify_mark_add_to_mask()
828 if (atomic_read(&group->num_marks) > group->fanotify_data.max_marks) in fanotify_add_new_mark()
829 return ERR_PTR(-ENOSPC); in fanotify_add_new_mark()
833 return ERR_PTR(-ENOMEM); in fanotify_add_new_mark()
848 __u32 mask, unsigned int flags, in fanotify_add_mark() argument
854 mutex_lock(&group->mark_mutex); in fanotify_add_mark()
859 mutex_unlock(&group->mark_mutex); in fanotify_add_mark()
863 added = fanotify_mark_add_to_mask(fsn_mark, mask, flags); in fanotify_add_mark()
864 if (added & ~fsnotify_conn_mask(fsn_mark->connector)) in fanotify_add_mark()
865 fsnotify_recalc_mask(fsn_mark->connector); in fanotify_add_mark()
866 mutex_unlock(&group->mark_mutex); in fanotify_add_mark()
873 struct vfsmount *mnt, __u32 mask, in fanotify_add_vfsmount_mark() argument
874 unsigned int flags, __kernel_fsid_t *fsid) in fanotify_add_vfsmount_mark() argument
876 return fanotify_add_mark(group, &real_mount(mnt)->mnt_fsnotify_marks, in fanotify_add_vfsmount_mark()
877 FSNOTIFY_OBJ_TYPE_VFSMOUNT, mask, flags, fsid); in fanotify_add_vfsmount_mark()
881 struct super_block *sb, __u32 mask, in fanotify_add_sb_mark() argument
882 unsigned int flags, __kernel_fsid_t *fsid) in fanotify_add_sb_mark() argument
884 return fanotify_add_mark(group, &sb->s_fsnotify_marks, in fanotify_add_sb_mark()
885 FSNOTIFY_OBJ_TYPE_SB, mask, flags, fsid); in fanotify_add_sb_mark()
889 struct inode *inode, __u32 mask, in fanotify_add_inode_mark() argument
890 unsigned int flags, __kernel_fsid_t *fsid) in fanotify_add_inode_mark() argument
899 if ((flags & FAN_MARK_IGNORED_MASK) && in fanotify_add_inode_mark()
900 !(flags & FAN_MARK_IGNORED_SURV_MODIFY) && in fanotify_add_inode_mark()
904 return fanotify_add_mark(group, &inode->i_fsnotify_marks, in fanotify_add_inode_mark()
905 FSNOTIFY_OBJ_TYPE_INODE, mask, flags, fsid); in fanotify_add_inode_mark()
917 oevent->type = FANOTIFY_EVENT_TYPE_OVERFLOW; in fanotify_alloc_overflow_event()
919 return &oevent->fse; in fanotify_alloc_overflow_event()
923 SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) in SYSCALL_DEFINE2() argument
928 unsigned int fid_mode = flags & FANOTIFY_FID_BITS; in SYSCALL_DEFINE2()
929 unsigned int class = flags & FANOTIFY_CLASS_BITS; in SYSCALL_DEFINE2()
931 pr_debug("%s: flags=%x event_f_flags=%x\n", in SYSCALL_DEFINE2()
932 __func__, flags, event_f_flags); in SYSCALL_DEFINE2()
935 return -EPERM; in SYSCALL_DEFINE2()
938 if (flags & ~(FANOTIFY_INIT_FLAGS | FAN_ENABLE_AUDIT)) in SYSCALL_DEFINE2()
940 if (flags & ~FANOTIFY_INIT_FLAGS) in SYSCALL_DEFINE2()
942 return -EINVAL; in SYSCALL_DEFINE2()
945 return -EINVAL; in SYSCALL_DEFINE2()
953 return -EINVAL; in SYSCALL_DEFINE2()
957 return -EINVAL; in SYSCALL_DEFINE2()
964 return -EINVAL; in SYSCALL_DEFINE2()
967 if (atomic_read(&user->fanotify_listeners) > FANOTIFY_DEFAULT_MAX_LISTENERS) { in SYSCALL_DEFINE2()
969 return -EMFILE; in SYSCALL_DEFINE2()
973 if (flags & FAN_CLOEXEC) in SYSCALL_DEFINE2()
975 if (flags & FAN_NONBLOCK) in SYSCALL_DEFINE2()
985 group->fanotify_data.user = user; in SYSCALL_DEFINE2()
986 group->fanotify_data.flags = flags; in SYSCALL_DEFINE2()
987 atomic_inc(&user->fanotify_listeners); in SYSCALL_DEFINE2()
988 group->memcg = get_mem_cgroup_from_mm(current->mm); in SYSCALL_DEFINE2()
990 group->overflow_event = fanotify_alloc_overflow_event(); in SYSCALL_DEFINE2()
991 if (unlikely(!group->overflow_event)) { in SYSCALL_DEFINE2()
992 fd = -ENOMEM; in SYSCALL_DEFINE2()
998 group->fanotify_data.f_flags = event_f_flags; in SYSCALL_DEFINE2()
999 init_waitqueue_head(&group->fanotify_data.access_waitq); in SYSCALL_DEFINE2()
1000 INIT_LIST_HEAD(&group->fanotify_data.access_list); in SYSCALL_DEFINE2()
1003 group->priority = FS_PRIO_0; in SYSCALL_DEFINE2()
1006 group->priority = FS_PRIO_1; in SYSCALL_DEFINE2()
1009 group->priority = FS_PRIO_2; in SYSCALL_DEFINE2()
1012 fd = -EINVAL; in SYSCALL_DEFINE2()
1016 if (flags & FAN_UNLIMITED_QUEUE) { in SYSCALL_DEFINE2()
1017 fd = -EPERM; in SYSCALL_DEFINE2()
1020 group->max_events = UINT_MAX; in SYSCALL_DEFINE2()
1022 group->max_events = FANOTIFY_DEFAULT_MAX_EVENTS; in SYSCALL_DEFINE2()
1025 if (flags & FAN_UNLIMITED_MARKS) { in SYSCALL_DEFINE2()
1026 fd = -EPERM; in SYSCALL_DEFINE2()
1029 group->fanotify_data.max_marks = UINT_MAX; in SYSCALL_DEFINE2()
1031 group->fanotify_data.max_marks = FANOTIFY_DEFAULT_MAX_MARKS; in SYSCALL_DEFINE2()
1034 if (flags & FAN_ENABLE_AUDIT) { in SYSCALL_DEFINE2()
1035 fd = -EPERM; in SYSCALL_DEFINE2()
1060 err = vfs_get_fsid(path->dentry, fsid); in fanotify_test_fid()
1064 if (!fsid->val[0] && !fsid->val[1]) in fanotify_test_fid()
1065 return -ENODEV; in fanotify_test_fid()
1071 err = vfs_get_fsid(path->dentry->d_sb->s_root, &root_fsid); in fanotify_test_fid()
1075 if (root_fsid.val[0] != fsid->val[0] || in fanotify_test_fid()
1076 root_fsid.val[1] != fsid->val[1]) in fanotify_test_fid()
1077 return -EXDEV; in fanotify_test_fid()
1086 if (!path->dentry->d_sb->s_export_op || in fanotify_test_fid()
1087 !path->dentry->d_sb->s_export_op->fh_to_dentry) in fanotify_test_fid()
1088 return -EOPNOTSUPP; in fanotify_test_fid()
1093 static int fanotify_events_supported(struct path *path, __u64 mask, in fanotify_events_supported() argument
1094 unsigned int flags) in fanotify_events_supported() argument
1096 unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS; in fanotify_events_supported()
1101 * deadlocking the system - open done when reporting fanotify event in fanotify_events_supported()
1106 if (mask & FANOTIFY_PERM_EVENTS && in fanotify_events_supported()
1107 path->mnt->mnt_sb->s_type->fs_flags & FS_DISALLOW_NOTIFY_PERM) in fanotify_events_supported()
1108 return -EINVAL; in fanotify_events_supported()
1121 path->mnt->mnt_sb->s_flags & SB_NOUSER) in fanotify_events_supported()
1122 return -EINVAL; in fanotify_events_supported()
1127 static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask, in do_fanotify_mark() argument
1137 unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS; in do_fanotify_mark()
1138 bool ignored = flags & FAN_MARK_IGNORED_MASK; in do_fanotify_mark()
1143 pr_debug("%s: fanotify_fd=%d flags=%x dfd=%d pathname=%p mask=%llx\n", in do_fanotify_mark()
1144 __func__, fanotify_fd, flags, dfd, pathname, mask); in do_fanotify_mark()
1147 if (mask & ((__u64)0xffffffff << 32)) in do_fanotify_mark()
1148 return -EINVAL; in do_fanotify_mark()
1150 if (flags & ~FANOTIFY_MARK_FLAGS) in do_fanotify_mark()
1151 return -EINVAL; in do_fanotify_mark()
1164 return -EINVAL; in do_fanotify_mark()
1167 switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_FLUSH)) { in do_fanotify_mark()
1170 if (!mask) in do_fanotify_mark()
1171 return -EINVAL; in do_fanotify_mark()
1174 if (flags & ~(FANOTIFY_MARK_TYPE_BITS | FAN_MARK_FLUSH)) in do_fanotify_mark()
1175 return -EINVAL; in do_fanotify_mark()
1178 return -EINVAL; in do_fanotify_mark()
1184 if (mask & ~valid_mask) in do_fanotify_mark()
1185 return -EINVAL; in do_fanotify_mark()
1187 /* Event flags (ONDIR, ON_CHILD) are meaningless in ignored mask */ in do_fanotify_mark()
1189 mask &= ~FANOTIFY_EVENT_FLAGS; in do_fanotify_mark()
1193 return -EBADF; in do_fanotify_mark()
1196 ret = -EINVAL; in do_fanotify_mark()
1197 if (unlikely(f.file->f_op != &fanotify_fops)) in do_fanotify_mark()
1199 group = f.file->private_data; in do_fanotify_mark()
1202 * group->priority == FS_PRIO_0 == FAN_CLASS_NOTIF. These are not in do_fanotify_mark()
1205 ret = -EINVAL; in do_fanotify_mark()
1206 if (mask & FANOTIFY_PERM_EVENTS && in do_fanotify_mark()
1207 group->priority == FS_PRIO_0) in do_fanotify_mark()
1212 * event->fd, so we do not allow setting a mask for inode events unless in do_fanotify_mark()
1218 if (mask & FANOTIFY_INODE_EVENTS && in do_fanotify_mark()
1222 if (flags & FAN_MARK_FLUSH) { in do_fanotify_mark()
1233 ret = fanotify_find_path(dfd, pathname, &path, flags, in do_fanotify_mark()
1234 (mask & ALL_FSNOTIFY_EVENTS), obj_type); in do_fanotify_mark()
1238 if (flags & FAN_MARK_ADD) { in do_fanotify_mark()
1239 ret = fanotify_events_supported(&path, mask, flags); in do_fanotify_mark()
1254 inode = path.dentry->d_inode; in do_fanotify_mark()
1258 /* Mask out FAN_EVENT_ON_CHILD flag for sb/mount/non-dir marks */ in do_fanotify_mark()
1259 if (mnt || !S_ISDIR(inode->i_mode)) { in do_fanotify_mark()
1260 mask &= ~FAN_EVENT_ON_CHILD; in do_fanotify_mark()
1264 * events with parent/name info for non-directory. in do_fanotify_mark()
1267 (flags & FAN_MARK_ADD) && !ignored) in do_fanotify_mark()
1268 mask |= FAN_EVENT_ON_CHILD; in do_fanotify_mark()
1272 switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) { in do_fanotify_mark()
1275 ret = fanotify_add_vfsmount_mark(group, mnt, mask, in do_fanotify_mark()
1276 flags, fsid); in do_fanotify_mark()
1278 ret = fanotify_add_sb_mark(group, mnt->mnt_sb, mask, in do_fanotify_mark()
1279 flags, fsid); in do_fanotify_mark()
1281 ret = fanotify_add_inode_mark(group, inode, mask, in do_fanotify_mark()
1282 flags, fsid); in do_fanotify_mark()
1286 ret = fanotify_remove_vfsmount_mark(group, mnt, mask, in do_fanotify_mark()
1287 flags, umask); in do_fanotify_mark()
1289 ret = fanotify_remove_sb_mark(group, mnt->mnt_sb, mask, in do_fanotify_mark()
1290 flags, umask); in do_fanotify_mark()
1292 ret = fanotify_remove_inode_mark(group, inode, mask, in do_fanotify_mark()
1293 flags, umask); in do_fanotify_mark()
1296 ret = -EINVAL; in do_fanotify_mark()
1307 SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, in SYSCALL_DEFINE5() argument
1308 __u64, mask, int, dfd, in SYSCALL_DEFINE5() argument
1311 return do_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname); in SYSCALL_DEFINE5()
1317 int, fanotify_fd, unsigned int, flags, in SYSCALL32_DEFINE6() argument
1318 SC_ARG64(mask), int, dfd, in SYSCALL32_DEFINE6() argument
1321 return do_fanotify_mark(fanotify_fd, flags, SC_VAL64(__u64, mask), in SYSCALL32_DEFINE6()
1327 * fanotify_user_setup - Our initialization function. Note that we cannot return
1328 * error because we have compiled-in VFS hooks. So an (unlikely) failure here