mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
vfs: Generalize filesystem nodev handling.
Introduce a function may_open_dev that tests MNT_NODEV and a new superblock flab SB_I_NODEV. Use this new function in all of the places where MNT_NODEV was previously tested. Add the new SB_I_NODEV s_iflag to proc, sysfs, and mqueuefs as those filesystems should never support device nodes, and a simple superblock flags makes that very hard to get wrong. With SB_I_NODEV set if any device nodes somehow manage to show up on on a filesystem those device nodes will be unopenable. Acked-by: Seth Forshee <[email protected]> Signed-off-by: "Eric W. Biederman" <[email protected]>
This commit is contained in:
parent
3ee690143c
commit
a2982cc922
6 changed files with 15 additions and 7 deletions
|
|
@ -307,7 +307,7 @@ static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
|
|||
struct inode *inode;
|
||||
struct ipc_namespace *ns = sb->s_fs_info;
|
||||
|
||||
sb->s_iflags |= SB_I_NOEXEC;
|
||||
sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV;
|
||||
sb->s_blocksize = PAGE_SIZE;
|
||||
sb->s_blocksize_bits = PAGE_SHIFT;
|
||||
sb->s_magic = MQUEUE_MAGIC;
|
||||
|
|
|
|||
Loading…
Reference in a new issue