diff options
author | Naveen Kumar Parna <parna.naveenkumar@gmail.com> | 2019-01-22 16:44:02 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-22 16:56:00 +0300 |
commit | f9f7bb9e0a0ca33f65a3deae9ec5e07266908fc5 (patch) | |
tree | 87e1a985ac2808807b65daa5b987e1e194af0f72 /drivers/char/mbcs.c | |
parent | ec74136ded792deed80780a2f8baf3521eeb72f9 (diff) | |
download | linux-f9f7bb9e0a0ca33f65a3deae9ec5e07266908fc5.tar.xz |
mbcs: add .owner to mbcs struct file_operations
Without ".owner = THIS_MODULE" it is possible to crash the kernel
by unloading the mbcs module while someone works with the file.
Fix this by initializing the ‘struct file_operations' ->owner with
THIS_MODULE.
Signed-off-by: Naveen Kumar Parna <parna.naveenkumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/mbcs.c')
-rw-r--r-- | drivers/char/mbcs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 8c9216a0f62e..0a31b60bee7b 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c @@ -50,6 +50,7 @@ static LIST_HEAD(soft_list); * file operations */ static const struct file_operations mbcs_ops = { + .owner = THIS_MODULE, .open = mbcs_open, .llseek = mbcs_sram_llseek, .read = mbcs_sram_read, |