Message ID | 20230513051210.1446682-2-tytso@mit.edu |
---|---|
State | New |
Headers | show |
Series | [-v2,1/2] ext4: add bounds checking in get_max_inline_xattr_value_size() | expand |
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index f47adb284e90..5854bd5a3352 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -360,7 +360,7 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode, error = ext4_xattr_ibody_get(inode, i.name_index, i.name, value, len); - if (error == -ENODATA) + if (error < 0) goto out; BUFFER_TRACE(is.iloc.bh, "get_write_access");
If ext4_update_inline_data() fails for any reason, it's best if we just fail as opposed to stumbling on, especially if the failure is EFSCORRUPTED. Signed-off-by: Theodore Ts'o <tytso@mit.edu> --- Changes from -v1: fixed error check to be for negative values fs/ext4/inline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)