diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-06-13 15:17:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-06 19:06:50 +0200 |
commit | c47e2552607174787e65ac3713c16cbae2c0e7d0 (patch) | |
tree | 82531f3fb4ec4f53cea59eaf6b59e895ffddcbdf /lib/test_string.c | |
parent | b39c377ea08f377367297b7369f0e580c5cd189d (diff) |
ceph: return -ERANGE if virtual xattr value didn't fit in buffer
[ Upstream commit 3b421018f48c482bdc9650f894aa1747cf90e51d ]
The getxattr manpage states that we should return ERANGE if the
destination buffer size is too small to hold the value.
ceph_vxattrcb_layout does this internally, but we should be doing
this for all vxattrs.
Fix the only caller of getxattr_cb to check the returned size
against the buffer length and return -ERANGE if it doesn't fit.
Drop the same check in ceph_vxattrcb_layout and just rely on the
caller to handle it.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Acked-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/test_string.c')
0 files changed, 0 insertions, 0 deletions