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

Merge tag 'jfs-3.14' of git://github.com/kleikamp/linux-shaggy

Pull jfs fix from David Kleikamp:
"Minor bug fix for linux-3.14"

* tag 'jfs-3.14' of git://github.com/kleikamp/linux-shaggy:
jfs: fix xattr value size overflow in __jfs_setxattr

+14 -1
+14 -1
fs/jfs/xattr.c
··· 791 791 /* Completely new ea list */ 792 792 xattr_size = sizeof (struct jfs_ea_list); 793 793 794 + /* 795 + * The size of EA value is limitted by on-disk format up to 796 + * __le16, there would be an overflow if the size is equal 797 + * to XATTR_SIZE_MAX (65536). In order to avoid this issue, 798 + * we can pre-checkup the value size against USHRT_MAX, and 799 + * return -E2BIG in this case, which is consistent with the 800 + * VFS setxattr interface. 801 + */ 802 + if (value_len >= USHRT_MAX) { 803 + rc = -E2BIG; 804 + goto release; 805 + } 806 + 794 807 ea = (struct jfs_ea *) ((char *) ealist + xattr_size); 795 808 ea->flag = 0; 796 809 ea->namelen = namelen; ··· 818 805 /* DEBUG - If we did this right, these number match */ 819 806 if (xattr_size != new_size) { 820 807 printk(KERN_ERR 821 - "jfs_xsetattr: xattr_size = %d, new_size = %d\n", 808 + "__jfs_setxattr: xattr_size = %d, new_size = %d\n", 822 809 xattr_size, new_size); 823 810 824 811 rc = -EINVAL;