[openeuler:OLK-6.6 2229/2229] kernel/livepatch/core.c:2046: warning: bad line:

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: a8743142c88fdbade6ffcd3cf426037633e9e1fc commit: 29f85d3cff2dfa35ace94d3e4036d5ea456eb859 [2229/2229] livepatch: Add klp_module_delete_safety_check config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250514/202505141516.wTret3B2-lkp@i...) compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff) rustc: rustc 1.71.1 (eb26296b5 2023-08-03) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250514/202505141516.wTret3B2-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202505141516.wTret3B2-lkp@intel.com/ All warnings (new ones prefixed by >>):
kernel/livepatch/core.c:2046: warning: bad line:
vim +2046 kernel/livepatch/core.c 2033 2034 /** 2035 * klp_module_delete_safety_check() - safety check in livepatch scenario when delete a module 2036 * @mod: Module to be deleted 2037 * 2038 * Module refcnt ensures that there is no rare case between enable_patch and delete_module: 2039 * 1. safety_check -> try_enable_patch -> try_release_module_ref: 2040 * try_enable_patch would increase module refcnt, which cause try_release_module_ref fails. 2041 * 2. safety_check -> try_release_module_ref -> try_enable_patch: 2042 * after release module ref, try_enable_patch would fail because try_module_get fails. 2043 * So the problem that release resources unsafely when enable livepatch after safety_check is 2044 * passed during module deletion does not exist, complex synchronization protection is not 2045 * required.
2046 2047 * Return: 0 on success, otherwise error 2048 */ 2049 int klp_module_delete_safety_check(struct module *mod) 2050 { 2051 int ret; 2052 2053 if (!mod || !is_livepatch_module(mod)) 2054 return 0; 2055 2056 ret = stop_machine(arch_klp_module_check_calltrace, (void *)mod, NULL); 2057 if (ret) { 2058 pr_debug("failed to check klp module calltrace: %d\n", ret); 2059 return ret; 2060 } 2061 2062 return 0; 2063 } 2064
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot