Skip to contentSkip to conversation

netdevsim: set .owner to THIS_MODULE

PATCH Applied Taehee Yoo 2 participants 2 messages Nov 15, 2020 – Nov 17, 2020

Subsystems (3)
lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH v3 1/1 netdevsim: set .owner to THIS_MODULE

If THIS_MODULE is not set, the module would be removed while debugfs is being used.
It eventually makes kernel panic.

Fixes 82c93a87bf8b ("netdevsim: implement couple of testing devlink health reporters")
Fixes 424be63ad831 ("netdevsim: add UDP tunnel port offload support")
Fixes 4418f862d675 ("netdevsim: implement support for devlink region and snapshots")
Fixes d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata")

---

v3:
- Separate from one big series

v2:
- Change headline
- Squash patches into per-driver/subsystem

 drivers/net/netdevsim/dev.c         | 2 ++
 drivers/net/netdevsim/health.c      | 1 +
 drivers/net/netdevsim/udp_tunnels.c | 1 +
 3 files changed, 4 insertions(+)
drivers/net/netdevsim/dev.c +2 -0
index d07061417675..e7972e88ffe0 100644
@@ -96,6 +96,7 @@ static const struct file_operations nsim_dev_take_snapshot_fops = {
 	.open = simple_open,
 	.write = nsim_dev_take_snapshot_write,
 	.llseek = generic_file_llseek,
+	.owner = THIS_MODULE,
 };
 
 static ssize_t nsim_dev_trap_fa_cookie_read(struct file *file,
@@ -188,6 +189,7 @@ static const struct file_operations nsim_dev_trap_fa_cookie_fops = {
 	.read = nsim_dev_trap_fa_cookie_read,
 	.write = nsim_dev_trap_fa_cookie_write,
 	.llseek = generic_file_llseek,
+	.owner = THIS_MODULE,
 };
 
 static int nsim_dev_debugfs_init(struct nsim_dev *nsim_dev)
drivers/net/netdevsim/health.c +1 -0
index 62958b238d50..21e2974660e7 100644
@@ -261,6 +261,7 @@ static const struct file_operations nsim_dev_health_break_fops = {
 	.open = simple_open,
 	.write = nsim_dev_health_break_write,
 	.llseek = generic_file_llseek,
+	.owner = THIS_MODULE,
 };
 
 int nsim_dev_health_init(struct nsim_dev *nsim_dev, struct devlink *devlink)
drivers/net/netdevsim/udp_tunnels.c +1 -0
index 6ab023acefd6..02dc3123eb6c 100644
@@ -124,6 +124,7 @@ static const struct file_operations nsim_udp_tunnels_info_reset_fops = {
 	.open = simple_open,
 	.write = nsim_udp_tunnels_info_reset_write,
 	.llseek = generic_file_llseek,
+	.owner = THIS_MODULE,
 };
 
 int nsim_udp_tunnels_info_create(struct nsim_dev *nsim_dev,
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 11 lines · On Sun, 15 Nov 2020 10:30:41 +0000 you wrote:

If THIS_MODULE is not set, the module would be removed while debugfs is being used.
It eventually makes kernel panic.

Fixes 82c93a87bf8b ("netdevsim: implement couple of testing devlink health reporters")
Fixes 424be63ad831 ("netdevsim: add UDP tunnel port offload support")
Fixes 4418f862d675 ("netdevsim: implement support for devlink region and snapshots")
Fixes d3cbb907ae57 ("netdevsim: add ACL trap reporting cookie as a metadata")

[...]

Here is the summary with links:
- [v3,net] netdevsim: set .owner to THIS_MODULE

    https://git.kernel.org/netdev/net/c/a5bbcbf29089

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html