projects
/
platform
/
kernel
/
linux-rpi.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
|
history
diff --git
a/fs/hostfs/hostfs_kern.c
b/fs/hostfs/hostfs_kern.c
index
92b008f
..
8163aac
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;