Skip to content

Commit

Permalink
9p: fix mmap to be read-only
Browse files Browse the repository at this point in the history
v9fs was allowing writable mmap which could lead to kernel BUG() cases.
This sets the mmap function to generic_file_readonly_mmap which (correctly)
returns an error to applications which open mmap for writing.

Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
  • Loading branch information
Eric Van Hensbergen committed Feb 7, 2008
1 parent d199d65 commit 14b8869
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static const struct file_operations v9fs_cached_file_operations = {
.open = v9fs_file_open,
.release = v9fs_dir_release,
.lock = v9fs_file_lock,
.mmap = generic_file_mmap,
.mmap = generic_file_readonly_mmap,
};

const struct file_operations v9fs_file_operations = {
Expand All @@ -194,5 +194,5 @@ const struct file_operations v9fs_file_operations = {
.open = v9fs_file_open,
.release = v9fs_dir_release,
.lock = v9fs_file_lock,
.mmap = generic_file_mmap,
.mmap = generic_file_readonly_mmap,
};

0 comments on commit 14b8869

Please sign in to comment.