提交 14b8869f 编写于 作者: E Eric Van Hensbergen

9p: fix mmap to be read-only

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: NEric Van Hensbergen <ericvh@gmail.com>
上级 d199d652
...@@ -184,7 +184,7 @@ static const struct file_operations v9fs_cached_file_operations = { ...@@ -184,7 +184,7 @@ static const struct file_operations v9fs_cached_file_operations = {
.open = v9fs_file_open, .open = v9fs_file_open,
.release = v9fs_dir_release, .release = v9fs_dir_release,
.lock = v9fs_file_lock, .lock = v9fs_file_lock,
.mmap = generic_file_mmap, .mmap = generic_file_readonly_mmap,
}; };
const struct file_operations v9fs_file_operations = { const struct file_operations v9fs_file_operations = {
...@@ -194,5 +194,5 @@ const struct file_operations v9fs_file_operations = { ...@@ -194,5 +194,5 @@ const struct file_operations v9fs_file_operations = {
.open = v9fs_file_open, .open = v9fs_file_open,
.release = v9fs_dir_release, .release = v9fs_dir_release,
.lock = v9fs_file_lock, .lock = v9fs_file_lock,
.mmap = generic_file_mmap, .mmap = generic_file_readonly_mmap,
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册