Lines Matching refs:arg
706 struct fscrypt_add_key_arg arg; in fscrypt_ioctl_add_key() local
710 if (copy_from_user(&arg, uarg, sizeof(arg))) in fscrypt_ioctl_add_key()
713 if (!valid_key_spec(&arg.key_spec)) in fscrypt_ioctl_add_key()
716 if (memchr_inv(arg.__reserved, 0, sizeof(arg.__reserved))) in fscrypt_ioctl_add_key()
724 if (arg.key_spec.type == FSCRYPT_KEY_SPEC_TYPE_DESCRIPTOR && in fscrypt_ioctl_add_key()
730 if (arg.__flags) { in fscrypt_ioctl_add_key()
731 if (arg.__flags & ~__FSCRYPT_ADD_KEY_FLAG_HW_WRAPPED) in fscrypt_ioctl_add_key()
733 if (arg.key_spec.type != FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER) in fscrypt_ioctl_add_key()
738 if (arg.key_id) { in fscrypt_ioctl_add_key()
739 if (arg.raw_size != 0) in fscrypt_ioctl_add_key()
741 err = get_keyring_key(arg.key_id, arg.key_spec.type, &secret); in fscrypt_ioctl_add_key()
749 if (arg.raw_size < FSCRYPT_MIN_KEY_SIZE || in fscrypt_ioctl_add_key()
750 arg.raw_size > (secret.is_hw_wrapped ? in fscrypt_ioctl_add_key()
754 secret.size = arg.raw_size; in fscrypt_ioctl_add_key()
760 err = add_master_key(sb, &secret, &arg.key_spec); in fscrypt_ioctl_add_key()
766 if (arg.key_spec.type == FSCRYPT_KEY_SPEC_TYPE_IDENTIFIER && in fscrypt_ioctl_add_key()
767 copy_to_user(uarg->key_spec.u.identifier, arg.key_spec.u.identifier, in fscrypt_ioctl_add_key()
1034 struct fscrypt_remove_key_arg arg; in do_remove_key() local
1040 if (copy_from_user(&arg, uarg, sizeof(arg))) in do_remove_key()
1043 if (!valid_key_spec(&arg.key_spec)) in do_remove_key()
1046 if (memchr_inv(arg.__reserved, 0, sizeof(arg.__reserved))) in do_remove_key()
1053 if (arg.key_spec.type == FSCRYPT_KEY_SPEC_TYPE_DESCRIPTOR && in do_remove_key()
1058 mk = fscrypt_find_master_key(sb, &arg.key_spec); in do_remove_key()
1159 struct fscrypt_get_key_status_arg arg; in fscrypt_ioctl_get_key_status() local
1163 if (copy_from_user(&arg, uarg, sizeof(arg))) in fscrypt_ioctl_get_key_status()
1166 if (!valid_key_spec(&arg.key_spec)) in fscrypt_ioctl_get_key_status()
1169 if (memchr_inv(arg.__reserved, 0, sizeof(arg.__reserved))) in fscrypt_ioctl_get_key_status()
1172 arg.status_flags = 0; in fscrypt_ioctl_get_key_status()
1173 arg.user_count = 0; in fscrypt_ioctl_get_key_status()
1174 memset(arg.__out_reserved, 0, sizeof(arg.__out_reserved)); in fscrypt_ioctl_get_key_status()
1176 mk = fscrypt_find_master_key(sb, &arg.key_spec); in fscrypt_ioctl_get_key_status()
1178 arg.status = FSCRYPT_KEY_STATUS_ABSENT; in fscrypt_ioctl_get_key_status()
1185 arg.status = refcount_read(&mk->mk_active_refs) > 0 ? in fscrypt_ioctl_get_key_status()
1192 arg.status = FSCRYPT_KEY_STATUS_PRESENT; in fscrypt_ioctl_get_key_status()
1196 arg.user_count = mk->mk_users->keys.nr_leaves_on_tree; in fscrypt_ioctl_get_key_status()
1199 arg.status_flags |= in fscrypt_ioctl_get_key_status()
1212 if (!err && copy_to_user(uarg, &arg, sizeof(arg))) in fscrypt_ioctl_get_key_status()