projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c6dcaf
)
hostfs: Handle bogus st.mode
author
Richard Weinberger
<richard@nod.at>
Sun, 1 Mar 2015 23:10:25 +0000
(
00:10
+0100)
committer
Richard Weinberger
<richard@nod.at>
Thu, 26 Mar 2015 22:27:49 +0000
(23:27 +0100)
Make sure that we return EIO if one passes an invalid st.mode
into hostfs.
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/hostfs/hostfs_kern.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/hostfs/hostfs_kern.c
b/fs/hostfs/hostfs_kern.c
index 92b008f564a457127f83c6db084d84f82fb0c9c8..8163aac81c21febcaec40a2968991c19fc7887ce 100644
(file)
--- a/
fs/hostfs/hostfs_kern.c
+++ b/
fs/hostfs/hostfs_kern.c
@@
-534,11
+534,13
@@
static int read_name(struct inode *ino, char *name)
init_special_inode(ino, st.mode & S_IFMT, rdev);
ino->i_op = &hostfs_iops;
break;
-
- default:
+ case S_IFREG:
ino->i_op = &hostfs_iops;
ino->i_fop = &hostfs_file_fops;
ino->i_mapping->a_ops = &hostfs_aops;
+ break;
+ default:
+ return -EIO;
}
ino->i_ino = st.ino;