projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6dd834e
)
ext4: enforce we are operating on a regular file in ext4_zero_range()
author
jon ernst
<jonernst07@gmail.com>
Fri, 18 Apr 2014 15:50:35 +0000
(11:50 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Fri, 18 Apr 2014 15:50:35 +0000
(11:50 -0400)
Signed-off-by: Jon Ernst <jonernst07@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/extents.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/ext4/extents.c
b/fs/ext4/extents.c
index d0860f2d36d0aae5c7f8890fb44e67369264f634..2f49b12a4c40f66b6ec2700a5655d16bc30fc5cf 100644
(file)
--- a/
fs/ext4/extents.c
+++ b/
fs/ext4/extents.c
@@
-4741,6
+4741,9
@@
static long ext4_zero_range(struct file *file, loff_t offset,
trace_ext4_zero_range(inode, offset, len, mode);
+ if (!S_ISREG(inode->i_mode))
+ return -EINVAL;
+
/*
* Write out all dirty pages to avoid race conditions
* Then release them.