Lines Matching refs:name
57 xattr_resolve_name(struct inode *inode, const char **name) in xattr_resolve_name() argument
70 n = strcmp_prefix(*name, xattr_prefix(handler)); in xattr_resolve_name()
77 *name = n; in xattr_resolve_name()
115 const char *name, int mask) in xattr_permission() argument
129 if (!strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) || in xattr_permission()
130 !strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN)) in xattr_permission()
136 if (!strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN)) { in xattr_permission()
147 if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { in xattr_permission()
186 struct inode *inode, const char *name, const void *value, in __vfs_setxattr() argument
191 if (is_posix_acl_xattr(name)) in __vfs_setxattr()
194 handler = xattr_resolve_name(inode, &name); in __vfs_setxattr()
201 return handler->set(handler, idmap, dentry, inode, name, value, in __vfs_setxattr()
224 struct dentry *dentry, const char *name, in __vfs_setxattr_noperm() argument
229 int issec = !strncmp(name, XATTR_SECURITY_PREFIX, in __vfs_setxattr_noperm()
235 error = __vfs_setxattr(idmap, dentry, inode, name, value, in __vfs_setxattr_noperm()
239 security_inode_post_setxattr(dentry, name, value, in __vfs_setxattr_noperm()
250 const char *suffix = name + XATTR_SECURITY_PREFIX_LEN; in __vfs_setxattr_noperm()
277 const char *name, const void *value, size_t size, in __vfs_setxattr_locked() argument
283 error = xattr_permission(idmap, inode, name, MAY_WRITE); in __vfs_setxattr_locked()
287 error = security_inode_setxattr(idmap, dentry, name, value, size, in __vfs_setxattr_locked()
296 error = __vfs_setxattr_noperm(idmap, dentry, name, value, in __vfs_setxattr_locked()
306 const char *name, const void *value, size_t size, int flags) in vfs_setxattr() argument
313 if (size && strcmp(name, XATTR_NAME_CAPS) == 0) { in vfs_setxattr()
322 error = __vfs_setxattr_locked(idmap, dentry, name, value, size, in vfs_setxattr()
340 const char *name, void *value, size_t size) in xattr_getsecurity() argument
346 len = security_inode_getsecurity(idmap, inode, name, in xattr_getsecurity()
351 len = security_inode_getsecurity(idmap, inode, name, &buffer, in xattr_getsecurity()
377 const char *name, char **xattr_value, size_t xattr_size, in vfs_getxattr_alloc() argument
385 error = xattr_permission(idmap, inode, name, MAY_READ); in vfs_getxattr_alloc()
389 handler = xattr_resolve_name(inode, &name); in vfs_getxattr_alloc()
394 error = handler->get(handler, dentry, inode, name, NULL, 0); in vfs_getxattr_alloc()
405 error = handler->get(handler, dentry, inode, name, value, error); in vfs_getxattr_alloc()
411 __vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name, in __vfs_getxattr() argument
416 if (is_posix_acl_xattr(name)) in __vfs_getxattr()
419 handler = xattr_resolve_name(inode, &name); in __vfs_getxattr()
424 return handler->get(handler, dentry, inode, name, value, size); in __vfs_getxattr()
430 const char *name, void *value, size_t size) in vfs_getxattr() argument
435 error = xattr_permission(idmap, inode, name, MAY_READ); in vfs_getxattr()
439 error = security_inode_getxattr(dentry, name); in vfs_getxattr()
443 if (!strncmp(name, XATTR_SECURITY_PREFIX, in vfs_getxattr()
445 const char *suffix = name + XATTR_SECURITY_PREFIX_LEN; in vfs_getxattr()
457 return __vfs_getxattr(dentry, inode, name, value, size); in vfs_getxattr()
506 const char *name) in __vfs_removexattr() argument
511 if (is_posix_acl_xattr(name)) in __vfs_removexattr()
514 handler = xattr_resolve_name(inode, &name); in __vfs_removexattr()
519 return handler->set(handler, idmap, dentry, inode, name, NULL, 0, in __vfs_removexattr()
536 struct dentry *dentry, const char *name, in __vfs_removexattr_locked() argument
542 error = xattr_permission(idmap, inode, name, MAY_WRITE); in __vfs_removexattr_locked()
546 error = security_inode_removexattr(idmap, dentry, name); in __vfs_removexattr_locked()
554 error = __vfs_removexattr(idmap, dentry, name); in __vfs_removexattr_locked()
558 evm_inode_post_removexattr(dentry, name); in __vfs_removexattr_locked()
568 const char *name) in vfs_removexattr() argument
577 name, &delegated_inode); in vfs_removexattr()
594 int setxattr_copy(const char __user *name, struct xattr_ctx *ctx) in setxattr_copy() argument
601 error = strncpy_from_user(ctx->kname->name, name, in setxattr_copy()
602 sizeof(ctx->kname->name)); in setxattr_copy()
603 if (error == 0 || error == sizeof(ctx->kname->name)) in setxattr_copy()
626 if (is_posix_acl_xattr(ctx->kname->name)) in do_setxattr()
627 return do_set_acl(idmap, dentry, ctx->kname->name, in do_setxattr()
630 return vfs_setxattr(idmap, dentry, ctx->kname->name, in do_setxattr()
635 const char __user *name, const void __user *value, in path_setxattr() argument
649 error = setxattr_copy(name, &ctx); in path_setxattr()
674 const char __user *, name, const void __user *, value, in SYSCALL_DEFINE5()
677 return path_setxattr(pathname, name, value, size, flags, LOOKUP_FOLLOW); in SYSCALL_DEFINE5()
681 const char __user *, name, const void __user *, value, in SYSCALL_DEFINE5()
684 return path_setxattr(pathname, name, value, size, flags, 0); in SYSCALL_DEFINE5()
687 SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, in SYSCALL_DEFINE5() argument
705 error = setxattr_copy(name, &ctx); in SYSCALL_DEFINE5()
727 char *kname = ctx->kname->name; in do_getxattr()
737 if (is_posix_acl_xattr(ctx->kname->name)) in do_getxattr()
755 const char __user *name, void __user *value, size_t size) in getxattr() argument
767 error = strncpy_from_user(kname.name, name, sizeof(kname.name)); in getxattr()
768 if (error == 0 || error == sizeof(kname.name)) in getxattr()
780 const char __user *name, void __user *value, in path_getxattr() argument
789 error = getxattr(mnt_idmap(path.mnt), path.dentry, name, value, size); in path_getxattr()
799 const char __user *, name, void __user *, value, size_t, size) in SYSCALL_DEFINE4()
801 return path_getxattr(pathname, name, value, size, LOOKUP_FOLLOW); in SYSCALL_DEFINE4()
805 const char __user *, name, void __user *, value, size_t, size) in SYSCALL_DEFINE4()
807 return path_getxattr(pathname, name, value, size, 0); in SYSCALL_DEFINE4()
810 SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name, in SYSCALL_DEFINE4() argument
820 name, value, size); in SYSCALL_DEFINE4()
904 removexattr(struct mnt_idmap *idmap, struct dentry *d, const char *name) in removexattr() argument
906 if (is_posix_acl_xattr(name)) in removexattr()
907 return vfs_remove_acl(idmap, d, name); in removexattr()
908 return vfs_removexattr(idmap, d, name); in removexattr()
912 const char __user *name, unsigned int lookup_flags) in path_removexattr() argument
918 error = strncpy_from_user(kname, name, sizeof(kname)); in path_removexattr()
941 const char __user *, name) in SYSCALL_DEFINE2()
943 return path_removexattr(pathname, name, LOOKUP_FOLLOW); in SYSCALL_DEFINE2()
947 const char __user *, name) in SYSCALL_DEFINE2()
949 return path_removexattr(pathname, name, 0); in SYSCALL_DEFINE2()
952 SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) in SYSCALL_DEFINE2() argument
962 error = strncpy_from_user(kname, name, sizeof(kname)); in SYSCALL_DEFINE2()
978 int xattr_list_one(char **buffer, ssize_t *remaining_size, const char *name) in xattr_list_one() argument
982 len = strlen(name) + 1; in xattr_list_one()
986 memcpy(*buffer, name, len); in xattr_list_one()
1012 if (!handler->name || (handler->list && !handler->list(dentry))) in generic_listxattr()
1014 err = xattr_list_one(&buffer, &remaining_size, handler->name); in generic_listxattr()
1039 const char *name) in xattr_full_name() argument
1043 return name - prefix_len; in xattr_full_name()
1058 size_t simple_xattr_space(const char *name, size_t size) in simple_xattr_space() argument
1064 return 40 + size + strlen(name); in simple_xattr_space()
1076 kfree(xattr->name); in simple_xattr_free()
1126 return strcmp(xattr->name, xattr_name); in rbtree_simple_xattr_cmp()
1144 return rbtree_simple_xattr_cmp(xattr->name, node); in rbtree_simple_xattr_node_cmp()
1162 int simple_xattr_get(struct simple_xattrs *xattrs, const char *name, in simple_xattr_get() argument
1170 rbp = rb_find(name, &xattrs->rb_root, rbtree_simple_xattr_cmp); in simple_xattr_get()
1212 const char *name, const void *value, in simple_xattr_set() argument
1225 new_xattr->name = kstrdup(name, GFP_KERNEL_ACCOUNT); in simple_xattr_set()
1226 if (!new_xattr->name) { in simple_xattr_set()
1236 ret = rbtree_simple_xattr_cmp(name, *rbp); in simple_xattr_set()
1289 static bool xattr_is_trusted(const char *name) in xattr_is_trusted() argument
1291 return !strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN); in xattr_is_trusted()
1331 if (!trusted && xattr_is_trusted(xattr->name)) in simple_xattr_list()
1334 err = xattr_list_one(&buffer, &remaining_size, xattr->name); in simple_xattr_list()
1411 *freed_space += simple_xattr_space(xattr->name, in simple_xattrs_free()