aboutsummaryrefslogtreecommitdiff
path: root/lib/test_fortify/write_overflow-strncpy-src.c
diff options
context:
space:
mode:
authorBaokun Li <[email protected]>2024-06-28 14:29:25 +0800
committerChristian Brauner <[email protected]>2024-07-03 10:36:15 +0200
commit0ece614a52bc9d219b839a6a29282b30d10e0c48 (patch)
treec4c1920ac80f6fa5f631d742fc483632b2955a71 /lib/test_fortify/write_overflow-strncpy-src.c
parent5d8f805789072ea7fd39504694b7bd17e5f751c4 (diff)
cachefiles: propagate errors from vfs_getxattr() to avoid infinite loop
In cachefiles_check_volume_xattr(), the error returned by vfs_getxattr() is not passed to ret, so it ends up returning -ESTALE, which leads to an endless loop as follows: cachefiles_acquire_volume retry: ret = cachefiles_check_volume_xattr ret = -ESTALE xlen = vfs_getxattr // return -EIO // The ret is not updated when xlen < 0, so -ESTALE is returned. return ret // Supposed to jump out of the loop at this judgement. if (ret != -ESTALE) goto error_dir; cachefiles_bury_object // EIO causes rename failure goto retry; Hence propagate the error returned by vfs_getxattr() to avoid the above issue. Do the same in cachefiles_check_auxdata(). Fixes: 32e150037dce ("fscache, cachefiles: Store the volume coherency data") Fixes: 72b957856b0c ("cachefiles: Implement metadata/coherency data storage in xattrs") Signed-off-by: Baokun Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Gao Xiang <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions