diff options
author | Tariq Saeed <tariq.x.saeed@oracle.com> | 2014-01-21 18:48:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 19:19:42 -0500 |
commit | a2a3b39824e152ecf0e7357ccc7b9d6fd4b9fe7e (patch) | |
tree | 95046c2f662bc40fe3237385dce585eca13e434e /fs | |
parent | 16eac4be46fdd19e4e0bcd06e77e947266d2cf35 (diff) |
ocfs2: punch hole should return EINVAL if the length argument in ioctl is negative
An unreserve space ioctl OCFS2_IOC_UNRESVSP/64 should reject a negative
length.
Orabug:14789508
Signed-off-by: Tariq Saseed <tariq.x.saeed@oracle.com>
Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 6fff128cad16..f42eecef6478 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1869,7 +1869,8 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, | |||
1869 | } | 1869 | } |
1870 | size = sr->l_start + sr->l_len; | 1870 | size = sr->l_start + sr->l_len; |
1871 | 1871 | ||
1872 | if (cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64) { | 1872 | if (cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64 || |
1873 | cmd == OCFS2_IOC_UNRESVSP || cmd == OCFS2_IOC_UNRESVSP64) { | ||
1873 | if (sr->l_len <= 0) { | 1874 | if (sr->l_len <= 0) { |
1874 | ret = -EINVAL; | 1875 | ret = -EINVAL; |
1875 | goto out_inode_unlock; | 1876 | goto out_inode_unlock; |