[PATCH v7 3/5] security: Replace indirect LSM hook calls with static calls

kernel test robot lkp at intel.com
Thu Nov 2 07:51:44 UTC 2023


Hi KP,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20231101]
[cannot apply to bpf-next/master bpf/master pcmoore-selinux/next linus/master v6.6 v6.6-rc7 v6.6-rc6 v6.6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/KP-Singh/kernel-Add-helper-macros-for-loop-unrolling/20231102-085857
base:   next-20231101
patch link:    https://lore.kernel.org/r/20231102005521.346983-4-kpsingh%40kernel.org
patch subject: [PATCH v7 3/5] security: Replace indirect LSM hook calls with static calls
config: x86_64-randconfig-013-20231102 (https://download.01.org/0day-ci/archive/20231102/202311021532.iBwuZUZ0-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231102/202311021532.iBwuZUZ0-lkp@intel.com/reproduce)

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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311021532.iBwuZUZ0-lkp@intel.com/

All errors (new ones prefixed by >>):

>> security/security.c:157:1: error: Only string constants are supported as initializers for randomized structures with flexible arrays
     157 | };
         | ^


vim +157 security/security.c

   136	
   137	/*
   138	 * Initialise a table of static calls for each LSM hook.
   139	 * DEFINE_STATIC_CALL_NULL invocation above generates a key (STATIC_CALL_KEY)
   140	 * and a trampoline (STATIC_CALL_TRAMP) which are used to call
   141	 * __static_call_update when updating the static call.
   142	 */
   143	struct lsm_static_calls_table static_calls_table __ro_after_init = {
   144	#define INIT_LSM_STATIC_CALL(NUM, NAME)					\
   145		(struct lsm_static_call) {					\
   146			.key = &STATIC_CALL_KEY(LSM_STATIC_CALL(NAME, NUM)),	\
   147			.trampoline = LSM_HOOK_TRAMP(NAME, NUM),		\
   148			.active = &SECURITY_HOOK_ACTIVE_KEY(NAME, NUM),		\
   149		},
   150	#define LSM_HOOK(RET, DEFAULT, NAME, ...)				\
   151		.NAME = {							\
   152			LSM_DEFINE_UNROLL(INIT_LSM_STATIC_CALL, NAME)		\
   153		},
   154	#include <linux/lsm_hook_defs.h>
   155	#undef LSM_HOOK
   156	#undef INIT_LSM_STATIC_CALL
 > 157	};
   158	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



More information about the Linux-security-module-archive mailing list