From 1ae381dafd81fef12cbfd1f171937b14f5af8596 Mon Sep 17 00:00:00 2001 From: Nolen Johnson Date: Sun, 30 Aug 2026 12:55:30 -0400 Subject: [PATCH] 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 --- techpack/data/drivers/rmnet/perf/rmnet_perf_config.c | 4 ++-- techpack/data/drivers/rmnet/shs/rmnet_shs_config.c | 4 ++-- techpack/data/drivers/rmnet/shs/rmnet_shs_config.h | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/techpack/data/drivers/rmnet/perf/rmnet_perf_config.c b/techpack/data/drivers/rmnet/perf/rmnet_perf_config.c index 1b3d4b058f9e..1c0765874c2c 100644 --- a/techpack/data/drivers/rmnet/perf/rmnet_perf_config.c +++ b/techpack/data/drivers/rmnet/perf/rmnet_perf_config.c @@ -455,13 +455,13 @@ static struct notifier_block rmnet_perf_dev_notifier __read_mostly = { .priority = 1, }; -int __init rmnet_perf_init(void) +static int __init rmnet_perf_init(void) { pr_info("%s(): initializing rmnet_perf\n", __func__); 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__); unregister_netdevice_notifier(&rmnet_perf_dev_notifier); diff --git a/techpack/data/drivers/rmnet/shs/rmnet_shs_config.c b/techpack/data/drivers/rmnet/shs/rmnet_shs_config.c index eeec5c876d50..91d448e7f9fc 100644 --- a/techpack/data/drivers/rmnet/shs/rmnet_shs_config.c +++ b/techpack/data/drivers/rmnet/shs/rmnet_shs_config.c @@ -47,7 +47,7 @@ static struct notifier_block rmnet_shs_dev_notifier __read_mostly = { static int rmnet_vnd_total; /* 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__); 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 */ -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, 0xDEF, 0xDEF, 0xDEF, 0xDEF, NULL, NULL); diff --git a/techpack/data/drivers/rmnet/shs/rmnet_shs_config.h b/techpack/data/drivers/rmnet/shs/rmnet_shs_config.h index 8d318c173bed..3ab6729cc28a 100644 --- a/techpack/data/drivers/rmnet/shs/rmnet_shs_config.h +++ b/techpack/data/drivers/rmnet/shs/rmnet_shs_config.h @@ -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 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_ */