Skip to content

Commit

Permalink
Fix crash when viewing nat46 kernel module config
Browse files Browse the repository at this point in the history
In the commit
91b8e68 Add network namespace awareness to nat46
the network namespace of the /proc/net file is now passed via
single_open() to nat46_proc_show(). However, the priv arg
passed to single_open() is accessed via the seq_file, not the
second value.
When using the second value, the 'network namespace' is invalid
and causes a kernel oops.

Access the network namespace in nat46_proc_show from
struct seq_file.
  • Loading branch information
coledishington committed Aug 1, 2024
1 parent 3a9f630 commit ab51a3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nat46/modules/nat46-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int nat46_proc_show(struct seq_file *m, void *v)
{
struct net *net;

net = (struct net *)v;
net = (struct net *)m->private;
nat64_show_all_configs(net, m);
return 0;
}
Expand Down

0 comments on commit ab51a3b

Please sign in to comment.