cfg80211: initialize regulatory keys/database later
authorJohannes Berg <johannes.berg@intel.com>
Thu, 26 Oct 2017 09:24:27 +0000 (11:24 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 20 Nov 2017 15:55:29 +0000 (16:55 +0100)
commitd7be102f2945a626f55e0501e52bb31ba3e77b81
tree22f632b38065929c1bb2e8c23c94202b2c5d95f9
parent7cca2acdff2d7c53b4a553756e731693152115d4
cfg80211: initialize regulatory keys/database later

When cfg80211 is built as a module, everything is fine, and we
can keep the code as is; in fact, we have to, because there can
only be a single module_init().

When cfg80211 is built-in, however, it needs to initialize
before drivers (device_initcall/module_init), and thus used to
be at subsys_initcall(). I'd moved it to fs_initcall() earlier,
where it can remain. However, this is still too early because at
that point the key infrastructure hasn't been initialized yet,
so X.509 certificates can't be parsed yet.

To work around this problem, load the regdb keys only later in
a late_initcall(), at which point the necessary infrastructure
has been initialized.

Fixes: 90a53e4432b1 ("cfg80211: implement regdb signature checking")
Reported-by: Xiaolong Ye <xiaolong.ye@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/reg.c