Unverified Commit 36ade961 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14137 ocfs2: pass u64 to ocfs2_truncate_inline maybe overflow

parents aec1334d fa943f81
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1790,6 +1790,14 @@ int ocfs2_remove_inode_range(struct inode *inode,
		return 0;

	if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
		int id_count = ocfs2_max_inline_data_with_xattr(inode->i_sb, di);

		if (byte_start > id_count || byte_start + byte_len > id_count) {
			ret = -EINVAL;
			mlog_errno(ret);
			goto out;
		}

		ret = ocfs2_truncate_inline(inode, di_bh, byte_start,
					    byte_start + byte_len, 0);
		if (ret) {