Skip to contentSkip to conversation

ocfs2: silence an integer overflow warning

PATCH New Dan Carpenter 1 participant 1 message Jul 7, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: silence an integer overflow warning

My static checker complains that ->me_start + ->me_len can overflow. I haven't followed it through to see the implications but it seems simple enough to prevent the overflow.

---
move_extents in other less common file systems have this same warning as well.

fs/ocfs2/move_extents.c +2 -1
index e3d05d9..9ff405a 100644
@@ -1014,7 +1014,8 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp)
 		goto out_free;
 	}
 
-	if (range.me_start > i_size_read(inode)) {
+	if (range.me_start > i_size_read(inode) ||
+	    range.me_len > i_size_read(inode)) {
 		status = -EINVAL;
 		goto out_free;
 	}