Lines Matching refs:name
54 xattr_resolve_name(struct inode *inode, const char **name) in xattr_resolve_name() argument
67 n = strcmp_prefix(*name, xattr_prefix(handler)); in xattr_resolve_name()
74 *name = n; in xattr_resolve_name()
86 xattr_permission(struct inode *inode, const char *name, int mask) in xattr_permission() argument
108 if (!strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) || in xattr_permission()
109 !strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN)) in xattr_permission()
115 if (!strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN)) { in xattr_permission()
126 if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { in xattr_permission()
138 __vfs_setxattr(struct dentry *dentry, struct inode *inode, const char *name, in __vfs_setxattr() argument
143 handler = xattr_resolve_name(inode, &name); in __vfs_setxattr()
150 return handler->set(handler, dentry, inode, name, value, size, flags); in __vfs_setxattr()
170 int __vfs_setxattr_noperm(struct dentry *dentry, const char *name, in __vfs_setxattr_noperm() argument
175 int issec = !strncmp(name, XATTR_SECURITY_PREFIX, in __vfs_setxattr_noperm()
181 error = __vfs_setxattr(dentry, inode, name, value, size, flags); in __vfs_setxattr_noperm()
184 security_inode_post_setxattr(dentry, name, value, in __vfs_setxattr_noperm()
195 const char *suffix = name + XATTR_SECURITY_PREFIX_LEN; in __vfs_setxattr_noperm()
220 __vfs_setxattr_locked(struct dentry *dentry, const char *name, in __vfs_setxattr_locked() argument
227 error = xattr_permission(inode, name, MAY_WRITE); in __vfs_setxattr_locked()
231 error = security_inode_setxattr(dentry, name, value, size, flags); in __vfs_setxattr_locked()
239 error = __vfs_setxattr_noperm(dentry, name, value, size, flags); in __vfs_setxattr_locked()
247 vfs_setxattr(struct dentry *dentry, const char *name, const void *value, in vfs_setxattr() argument
256 error = __vfs_setxattr_locked(dentry, name, value, size, flags, in vfs_setxattr()
270 xattr_getsecurity(struct inode *inode, const char *name, void *value, in xattr_getsecurity() argument
277 len = security_inode_getsecurity(inode, name, &buffer, false); in xattr_getsecurity()
281 len = security_inode_getsecurity(inode, name, &buffer, true); in xattr_getsecurity()
304 vfs_getxattr_alloc(struct dentry *dentry, const char *name, char **xattr_value, in vfs_getxattr_alloc() argument
312 error = xattr_permission(inode, name, MAY_READ); in vfs_getxattr_alloc()
316 handler = xattr_resolve_name(inode, &name); in vfs_getxattr_alloc()
321 error = handler->get(handler, dentry, inode, name, NULL, 0, 0); in vfs_getxattr_alloc()
332 error = handler->get(handler, dentry, inode, name, value, error, 0); in vfs_getxattr_alloc()
338 __vfs_getxattr(struct dentry *dentry, struct inode *inode, const char *name, in __vfs_getxattr() argument
346 error = xattr_permission(inode, name, MAY_READ); in __vfs_getxattr()
350 error = security_inode_getxattr(dentry, name); in __vfs_getxattr()
354 if (!strncmp(name, XATTR_SECURITY_PREFIX, in __vfs_getxattr()
356 const char *suffix = name + XATTR_SECURITY_PREFIX_LEN; in __vfs_getxattr()
367 handler = xattr_resolve_name(inode, &name); in __vfs_getxattr()
372 return handler->get(handler, dentry, inode, name, value, size, flags); in __vfs_getxattr()
377 vfs_getxattr(struct dentry *dentry, const char *name, void *value, size_t size) in vfs_getxattr() argument
379 return __vfs_getxattr(dentry, dentry->d_inode, name, value, size, 0); in vfs_getxattr()
404 __vfs_removexattr(struct dentry *dentry, const char *name) in __vfs_removexattr() argument
409 handler = xattr_resolve_name(inode, &name); in __vfs_removexattr()
414 return handler->set(handler, dentry, inode, name, NULL, 0, XATTR_REPLACE); in __vfs_removexattr()
428 __vfs_removexattr_locked(struct dentry *dentry, const char *name, in __vfs_removexattr_locked() argument
434 error = xattr_permission(inode, name, MAY_WRITE); in __vfs_removexattr_locked()
438 error = security_inode_removexattr(dentry, name); in __vfs_removexattr_locked()
446 error = __vfs_removexattr(dentry, name); in __vfs_removexattr_locked()
450 evm_inode_post_removexattr(dentry, name); in __vfs_removexattr_locked()
459 vfs_removexattr(struct dentry *dentry, const char *name) in vfs_removexattr() argument
467 error = __vfs_removexattr_locked(dentry, name, &delegated_inode); in vfs_removexattr()
484 setxattr(struct dentry *d, const char __user *name, const void __user *value, in setxattr() argument
494 error = strncpy_from_user(kname, name, sizeof(kname)); in setxattr()
529 const char __user *name, const void __user *value, in path_setxattr() argument
540 error = setxattr(path.dentry, name, value, size, flags); in path_setxattr()
552 const char __user *, name, const void __user *, value, in SYSCALL_DEFINE5()
555 return path_setxattr(pathname, name, value, size, flags, LOOKUP_FOLLOW); in SYSCALL_DEFINE5()
559 const char __user *, name, const void __user *, value, in SYSCALL_DEFINE5()
562 return path_setxattr(pathname, name, value, size, flags, 0); in SYSCALL_DEFINE5()
565 SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, in SYSCALL_DEFINE5() argument
576 error = setxattr(f.file->f_path.dentry, name, value, size, flags); in SYSCALL_DEFINE5()
587 getxattr(struct dentry *d, const char __user *name, void __user *value, in getxattr() argument
594 error = strncpy_from_user(kname, name, sizeof(kname)); in getxattr()
627 const char __user *name, void __user *value, in path_getxattr() argument
636 error = getxattr(path.dentry, name, value, size); in path_getxattr()
646 const char __user *, name, void __user *, value, size_t, size) in SYSCALL_DEFINE4()
648 return path_getxattr(pathname, name, value, size, LOOKUP_FOLLOW); in SYSCALL_DEFINE4()
652 const char __user *, name, void __user *, value, size_t, size) in SYSCALL_DEFINE4()
654 return path_getxattr(pathname, name, value, size, 0); in SYSCALL_DEFINE4()
657 SYSCALL_DEFINE4(fgetxattr, int, fd, const char __user *, name, in SYSCALL_DEFINE4() argument
666 error = getxattr(f.file->f_path.dentry, name, value, size); in SYSCALL_DEFINE4()
750 removexattr(struct dentry *d, const char __user *name) in removexattr() argument
755 error = strncpy_from_user(kname, name, sizeof(kname)); in removexattr()
765 const char __user *name, unsigned int lookup_flags) in path_removexattr() argument
775 error = removexattr(path.dentry, name); in path_removexattr()
787 const char __user *, name) in SYSCALL_DEFINE2()
789 return path_removexattr(pathname, name, LOOKUP_FOLLOW); in SYSCALL_DEFINE2()
793 const char __user *, name) in SYSCALL_DEFINE2()
795 return path_removexattr(pathname, name, 0); in SYSCALL_DEFINE2()
798 SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) in SYSCALL_DEFINE2() argument
808 error = removexattr(f.file->f_path.dentry, name); in SYSCALL_DEFINE2()
827 if (!handler->name || in generic_listxattr()
830 size += strlen(handler->name) + 1; in generic_listxattr()
837 if (!handler->name || in generic_listxattr()
840 len = strlen(handler->name); in generic_listxattr()
843 memcpy(buf, handler->name, len + 1); in generic_listxattr()
869 const char *name) in xattr_full_name() argument
873 return name - prefix_len; in xattr_full_name()
902 int simple_xattr_get(struct simple_xattrs *xattrs, const char *name, in simple_xattr_get() argument
910 if (strcmp(name, xattr->name)) in simple_xattr_get()
940 int simple_xattr_set(struct simple_xattrs *xattrs, const char *name, in simple_xattr_set() argument
953 new_xattr->name = kstrdup(name, GFP_KERNEL); in simple_xattr_set()
954 if (!new_xattr->name) { in simple_xattr_set()
962 if (!strcmp(name, xattr->name)) { in simple_xattr_set()
984 kfree(xattr->name); in simple_xattr_set()
991 static bool xattr_is_trusted(const char *name) in xattr_is_trusted() argument
993 return !strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN); in xattr_is_trusted()
997 const char *name) in xattr_list_one() argument
999 size_t len = strlen(name) + 1; in xattr_list_one()
1003 memcpy(*buffer, name, len); in xattr_list_one()
1041 if (!trusted && xattr_is_trusted(xattr->name)) in simple_xattr_list()
1044 err = xattr_list_one(&buffer, &remaining_size, xattr->name); in simple_xattr_list()