Jie Liu 0439e091e3 jfs: fix xattr value size overflow in __jfs_setxattr
There is a potential overflow if the specified EA value size is
greater than USHRT_MAX because the size of value is limited by
the on-disk format (i.e, __le16), this issue could be reflected
via the tests below:
 # touch /jfs/testfile
 # setfattr -n user.comment -v `perl -e 'print "A"x65536'` /jfs/testfile
   setfattr: /jfs/testfile: Invalid argument

Syslog:
 ... jfs_xsetattr: xattr_size = 21, new_size = 65557

This patch add pre-checkups of EA value size against USHRT_MAX to
avoid this problem, and return -E2BIG which is consistent with the
VFS setxattr interface.  Moreover, fix the debug code to print the
correct function name.

With this fix:
 setfattr: /jfs/testfile: Argument list too long

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
2014-01-02 11:36:56 -06:00
..
2012-12-20 18:40:52 -05:00
2013-02-22 23:31:31 -05:00
2006-10-02 09:55:27 -05:00
2008-05-13 08:22:10 -05:00
2013-06-05 14:47:19 -05:00
2013-06-29 12:56:42 +04:00
2013-06-05 14:47:19 -05:00
2006-10-02 09:55:27 -05:00
2013-06-05 14:47:19 -05:00
2013-09-17 10:05:19 -05:00
2007-04-26 07:30:29 -05:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2010-08-09 11:25:17 +02:00
2013-06-05 14:47:19 -05:00
2013-06-05 14:47:19 -05:00
2009-01-09 15:42:04 -06:00
2006-10-02 09:55:27 -05:00
2006-10-02 09:55:27 -05:00
2013-06-05 14:47:19 -05:00
2009-01-09 15:42:04 -06:00
2009-02-02 13:43:28 -06:00
2013-07-11 10:19:34 -07:00
2013-06-05 14:47:19 -05:00
2013-06-05 14:47:19 -05:00
2010-04-16 08:05:50 -05:00