rmnet: shs, perf: Fix CFI failure on module init

[   18.258840] CFI failure (target: rmnet_shs_module_init+0x0/0xfa0 [rmnet_shs]):
[   18.258981]  __cfi_check_fail+0x3c/0x8c [rmnet_shs]
[   18.258991]  __cfi_check+0x424/0x484 [rmnet_shs]
[   18.258993]  __cfi_slowpath_diag+0x10c/0x188

module_init()/module_exit() define init_module/cleanup_module as aliases
of the given functions. With cross-DSO CFI, such an alias only gets its
own jump table entry when the aliasee has internal linkage. Since these
functions were declared non-static, modpost pointed __this_module.init
at the raw .init.text address instead of init_module.cfi_jt, so
__cfi_check() rejected the initcall pointer.

Make them static, as they should have been in the first place. The
declarations in rmnet_shs_config.h had no other users and are dropped.

Assisted-by: Claude Opus 5
Change-Id: I32206b52b830796e4ee0e11479791eec12304ced
This commit is contained in:
Nolen Johnson committed 2026-08-30 17:08:32 +00:00
1 parent 7b7869eefb
commit 1ae381dafd
3 files changed
+4 -8

No files matched your search

@@ -455,13 +455,13 @@ static struct notifier_block rmnet_perf_dev_notifier __read_mostly = {
.priority = 1, .priority = 1,
}; };
int __init rmnet_perf_init(void) static int __init rmnet_perf_init(void)
{ {
pr_info("%s(): initializing rmnet_perf\n", __func__); pr_info("%s(): initializing rmnet_perf\n", __func__);
return register_netdevice_notifier(&rmnet_perf_dev_notifier); return register_netdevice_notifier(&rmnet_perf_dev_notifier);
} }
void __exit rmnet_perf_exit(void) static void __exit rmnet_perf_exit(void)
{ {
pr_info("%s(): exiting rmnet_perf\n", __func__); pr_info("%s(): exiting rmnet_perf\n", __func__);
unregister_netdevice_notifier(&rmnet_perf_dev_notifier); unregister_netdevice_notifier(&rmnet_perf_dev_notifier);
@@ -47,7 +47,7 @@ static struct notifier_block rmnet_shs_dev_notifier __read_mostly = {
static int rmnet_vnd_total; static int rmnet_vnd_total;
/* Enable smart hashing capability upon call to initialize module*/ /* Enable smart hashing capability upon call to initialize module*/
int __init rmnet_shs_module_init(void) static int __init rmnet_shs_module_init(void)
{ {
pr_info("%s(): Starting rmnet SHS module\n", __func__); pr_info("%s(): Starting rmnet SHS module\n", __func__);
trace_rmnet_shs_high(RMNET_SHS_MODULE, RMNET_SHS_MODULE_INIT, trace_rmnet_shs_high(RMNET_SHS_MODULE, RMNET_SHS_MODULE_INIT,
@@ -61,7 +61,7 @@ int __init rmnet_shs_module_init(void)
} }
/* Remove smart hashing capability upon call to initialize module */ /* Remove smart hashing capability upon call to initialize module */
void __exit rmnet_shs_module_exit(void) static void __exit rmnet_shs_module_exit(void)
{ {
trace_rmnet_shs_high(RMNET_SHS_MODULE, RMNET_SHS_MODULE_EXIT, trace_rmnet_shs_high(RMNET_SHS_MODULE, RMNET_SHS_MODULE_EXIT,
0xDEF, 0xDEF, 0xDEF, 0xDEF, NULL, NULL); 0xDEF, 0xDEF, 0xDEF, 0xDEF, NULL, NULL);
@@ -58,8 +58,4 @@ extern unsigned long rmnet_shs_crit_err[RMNET_SHS_CRIT_ERR_MAX];
extern struct rmnet_shs_cfg_s rmnet_shs_cfg; extern struct rmnet_shs_cfg_s rmnet_shs_cfg;
extern int rmnet_is_real_dev_registered(const struct net_device *real_dev); extern int rmnet_is_real_dev_registered(const struct net_device *real_dev);
int __init rmnet_shs_module_init(void);
void __exit rmnet_shs_module_exit(void);
#endif /* _RMNET_SMHS_CONFIG_H_ */ #endif /* _RMNET_SMHS_CONFIG_H_ */