Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs fixes from Al Viro:
"Several obvious fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
Fix mountpoint reference leakage in linkat
hfsplus: use xattr handlers for removexattr
Typo in compat_sys_lseek() declaration
fs/super.c: sync ro remount after blocking writers
vfs: unexport the getname() symbol

+26 -51
+1 -1
fs/hfsplus/dir.c
··· 529 529 .setxattr = generic_setxattr, 530 530 .getxattr = generic_getxattr, 531 531 .listxattr = hfsplus_listxattr, 532 - .removexattr = hfsplus_removexattr, 532 + .removexattr = generic_removexattr, 533 533 #ifdef CONFIG_HFSPLUS_FS_POSIX_ACL 534 534 .get_acl = hfsplus_get_posix_acl, 535 535 .set_acl = hfsplus_set_posix_acl,
+1 -1
fs/hfsplus/inode.c
··· 331 331 .setxattr = generic_setxattr, 332 332 .getxattr = generic_getxattr, 333 333 .listxattr = hfsplus_listxattr, 334 - .removexattr = hfsplus_removexattr, 334 + .removexattr = generic_removexattr, 335 335 #ifdef CONFIG_HFSPLUS_FS_POSIX_ACL 336 336 .get_acl = hfsplus_get_posix_acl, 337 337 .set_acl = hfsplus_set_posix_acl,
+17 -43
fs/hfsplus/xattr.c
··· 11 11 #include "xattr.h" 12 12 #include "acl.h" 13 13 14 + static int hfsplus_removexattr(struct inode *inode, const char *name); 15 + 14 16 const struct xattr_handler *hfsplus_xattr_handlers[] = { 15 17 &hfsplus_xattr_osx_handler, 16 18 &hfsplus_xattr_user_handler, ··· 276 274 HFSPLUS_IS_RSRC(inode)) 277 275 return -EOPNOTSUPP; 278 276 279 - if (strncmp(name, XATTR_MAC_OSX_PREFIX, 280 - XATTR_MAC_OSX_PREFIX_LEN) == 0) 281 - name += XATTR_MAC_OSX_PREFIX_LEN; 282 - 283 - if (value == NULL) { 284 - value = ""; 285 - size = 0; 286 - } 277 + if (value == NULL) 278 + return hfsplus_removexattr(inode, name); 287 279 288 280 err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd); 289 281 if (err) { ··· 395 399 return err; 396 400 } 397 401 398 - static inline int is_osx_xattr(const char *xattr_name) 399 - { 400 - return !is_known_namespace(xattr_name); 401 - } 402 - 403 402 static int name_len(const char *xattr_name, int xattr_name_len) 404 403 { 405 404 int len = xattr_name_len + 1; 406 405 407 - if (is_osx_xattr(xattr_name)) 406 + if (!is_known_namespace(xattr_name)) 408 407 len += XATTR_MAC_OSX_PREFIX_LEN; 409 408 410 409 return len; ··· 410 419 int len = name_len; 411 420 int offset = 0; 412 421 413 - if (is_osx_xattr(xattr_name)) { 422 + if (!is_known_namespace(xattr_name)) { 414 423 strncpy(buffer, XATTR_MAC_OSX_PREFIX, XATTR_MAC_OSX_PREFIX_LEN); 415 424 offset += XATTR_MAC_OSX_PREFIX_LEN; 416 425 len += XATTR_MAC_OSX_PREFIX_LEN; ··· 487 496 !S_ISDIR(inode->i_mode)) || 488 497 HFSPLUS_IS_RSRC(inode)) 489 498 return -EOPNOTSUPP; 490 - 491 - if (strncmp(name, XATTR_MAC_OSX_PREFIX, 492 - XATTR_MAC_OSX_PREFIX_LEN) == 0) { 493 - /* skip "osx." prefix */ 494 - name += XATTR_MAC_OSX_PREFIX_LEN; 495 - /* 496 - * Don't allow retrieving properly prefixed attributes 497 - * by prepending them with "osx." 498 - */ 499 - if (is_known_namespace(name)) 500 - return -EOPNOTSUPP; 501 - } 502 499 503 500 if (!strcmp_xattr_finder_info(name)) 504 501 return hfsplus_getxattr_finder_info(inode, value, size); ··· 722 743 return res; 723 744 } 724 745 725 - int hfsplus_removexattr(struct dentry *dentry, const char *name) 746 + static int hfsplus_removexattr(struct inode *inode, const char *name) 726 747 { 727 748 int err = 0; 728 - struct inode *inode = dentry->d_inode; 729 749 struct hfs_find_data cat_fd; 730 750 u16 flags; 731 751 u16 cat_entry_type; 732 752 int is_xattr_acl_deleted = 0; 733 753 int is_all_xattrs_deleted = 0; 734 754 735 - if ((!S_ISREG(inode->i_mode) && 736 - !S_ISDIR(inode->i_mode)) || 737 - HFSPLUS_IS_RSRC(inode)) 738 - return -EOPNOTSUPP; 739 - 740 755 if (!HFSPLUS_SB(inode->i_sb)->attr_tree) 741 756 return -EOPNOTSUPP; 742 - 743 - if (strncmp(name, XATTR_MAC_OSX_PREFIX, 744 - XATTR_MAC_OSX_PREFIX_LEN) == 0) 745 - name += XATTR_MAC_OSX_PREFIX_LEN; 746 757 747 758 if (!strcmp_xattr_finder_info(name)) 748 759 return -EOPNOTSUPP; ··· 807 838 if (len > HFSPLUS_ATTR_MAX_STRLEN) 808 839 return -EOPNOTSUPP; 809 840 810 - strcpy(xattr_name, XATTR_MAC_OSX_PREFIX); 811 - strcpy(xattr_name + XATTR_MAC_OSX_PREFIX_LEN, name); 841 + /* 842 + * Don't allow retrieving properly prefixed attributes 843 + * by prepending them with "osx." 844 + */ 845 + if (is_known_namespace(name)) 846 + return -EOPNOTSUPP; 812 847 813 848 return hfsplus_getxattr(dentry, xattr_name, buffer, size); 814 849 } ··· 830 857 if (len > HFSPLUS_ATTR_MAX_STRLEN) 831 858 return -EOPNOTSUPP; 832 859 860 + /* 861 + * Don't allow setting properly prefixed attributes 862 + * by prepending them with "osx." 863 + */ 833 864 if (is_known_namespace(name)) 834 865 return -EOPNOTSUPP; 835 - 836 - strcpy(xattr_name, XATTR_MAC_OSX_PREFIX); 837 - strcpy(xattr_name + XATTR_MAC_OSX_PREFIX_LEN, name); 838 866 839 867 return hfsplus_setxattr(dentry, xattr_name, buffer, size, flags); 840 868 }
-2
fs/hfsplus/xattr.h
··· 40 40 41 41 ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size); 42 42 43 - int hfsplus_removexattr(struct dentry *dentry, const char *name); 44 - 45 43 int hfsplus_init_security(struct inode *inode, struct inode *dir, 46 44 const struct qstr *qstr); 47 45
+4 -2
fs/namei.c
··· 209 209 { 210 210 return getname_flags(filename, 0, NULL); 211 211 } 212 - EXPORT_SYMBOL(getname); 213 212 214 213 #ifdef CONFIG_AUDITSYSCALL 215 214 void putname(struct filename *name) ··· 3926 3927 done_path_create(&new_path, new_dentry); 3927 3928 if (delegated_inode) { 3928 3929 error = break_deleg_wait(&delegated_inode); 3929 - if (!error) 3930 + if (!error) { 3931 + path_put(&old_path); 3930 3932 goto retry; 3933 + } 3931 3934 } 3932 3935 if (retry_estale(error, how)) { 3936 + path_put(&old_path); 3933 3937 how |= LOOKUP_REVAL; 3934 3938 goto retry; 3935 3939 }
+2 -1
fs/super.c
··· 703 703 if (flags & MS_RDONLY) 704 704 acct_auto_close(sb); 705 705 shrink_dcache_sb(sb); 706 - sync_filesystem(sb); 707 706 708 707 remount_ro = (flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY); 709 708 ··· 718 719 return retval; 719 720 } 720 721 } 722 + 723 + sync_filesystem(sb); 721 724 722 725 if (sb->s_op->remount_fs) { 723 726 retval = sb->s_op->remount_fs(sb, &flags, data);
+1 -1
include/linux/compat.h
··· 337 337 asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd, 338 338 const struct compat_iovec __user *vec, 339 339 compat_ulong_t vlen, u32 pos_low, u32 pos_high); 340 - asmlinkage long comat_sys_lseek(unsigned int, compat_off_t, unsigned int); 340 + asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); 341 341 342 342 asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, 343 343 const compat_uptr_t __user *envp);