···791791 /* Completely new ea list */792792 xattr_size = sizeof (struct jfs_ea_list);793793794794+ /*795795+ * The size of EA value is limitted by on-disk format up to796796+ * __le16, there would be an overflow if the size is equal797797+ * to XATTR_SIZE_MAX (65536). In order to avoid this issue,798798+ * we can pre-checkup the value size against USHRT_MAX, and799799+ * return -E2BIG in this case, which is consistent with the800800+ * VFS setxattr interface.801801+ */802802+ if (value_len >= USHRT_MAX) {803803+ rc = -E2BIG;804804+ goto release;805805+ }806806+794807 ea = (struct jfs_ea *) ((char *) ealist + xattr_size);795808 ea->flag = 0;796809 ea->namelen = namelen;···818805 /* DEBUG - If we did this right, these number match */819806 if (xattr_size != new_size) {820807 printk(KERN_ERR821821- "jfs_xsetattr: xattr_size = %d, new_size = %d\n",808808+ "__jfs_setxattr: xattr_size = %d, new_size = %d\n",822809 xattr_size, new_size);823810824811 rc = -EINVAL;