diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-08-10 14:36:00 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-08-14 21:07:20 -0700 |
commit | f8c46cb39079b7415ada1affc4631ae761d8b621 (patch) | |
tree | 46e8ff39629914fe2d4d64f0c4cf0ff63790aa74 /fs/proc/proc_net.c | |
parent | d16d9d2ad778e8247617c10703dfd749c776f242 (diff) | |
download | linux-f8c46cb39079b7415ada1affc4631ae761d8b621.tar.bz2 |
netns: do not call pernet ops for not yet set up init_net namespace
When CONFIG_NET_NS is disabled, registering pernet operations causes
init() to be called immediately with init_net as an argument. Unfortunately
this leads to some pernet ops, such as proc_net_ns_init() to be called too
early, when init_net namespace has not been fully initialized. This causes
issues when we want to change pernet ops to use more data from the net
namespace in question, for example reference user namespace that owns our
network namespace.
To fix this we could either play game of musical chairs and rearrange init
order, or we could do the same as when CONFIG_NET_NS is enabled, and
postpone calling pernet ops->init() until namespace is set up properly.
Note that we can not simply undo commit ed160e839d2e ("[NET]: Cleanup
pernet operation without CONFIG_NET_NS") and use the same implementations
for __register_pernet_operations() and __unregister_pernet_operations(),
because many pernet ops are marked as __net_initdata and will be discarded,
which wreaks havoc on our ops lists. Here we rely on the fact that we only
use lists until init_net is fully initialized, which happens much earlier
than discarding __net_initdata sections.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/proc/proc_net.c')
0 files changed, 0 insertions, 0 deletions