* [Ocfs2-devel] [patch] ocfs2: silence an integer overflow warning
@ 2016-07-07 8:12 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-07-07 8:12 UTC (permalink / raw)
To: Mark Fasheh; +Cc: Joel Becker, ocfs2-devel, linux-kernel, kernel-janitors
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
move_extents in other less common file systems have this same warning as
well.
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
index e3d05d9..9ff405a 100644
--- a/fs/ocfs2/move_extents.c
+++ b/fs/ocfs2/move_extents.c
@@ -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;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-07 8:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-07 8:12 [Ocfs2-devel] [patch] ocfs2: silence an integer overflow warning Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).