Skip to content

Commit

Permalink
orangefs: add .owner to debugfs file_operations
Browse files Browse the repository at this point in the history
Without ".owner = THIS_MODULE" it is possible to crash the kernel
by unloading the Orangefs module while someone is reading debugfs
files.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
hubcapsc committed Nov 16, 2016
1 parent dc03362 commit 19ff7fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/orangefs/orangefs-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@ static const struct seq_operations help_debug_ops = {
};

const struct file_operations debug_help_fops = {
.owner = THIS_MODULE,
.open = orangefs_debug_help_open,
.read = seq_read,
.release = seq_release,
.llseek = seq_lseek,
};

static const struct file_operations kernel_debug_fops = {
.owner = THIS_MODULE,
.open = orangefs_debug_open,
.read = orangefs_debug_read,
.write = orangefs_debug_write,
Expand Down

0 comments on commit 19ff7fc

Please sign in to comment.